wlplan.feature_generator

class Features
collect(*args, **kwargs)

Overloaded function.

  1. collect(self: _wlplan.feature_generator.Features, dataset: _wlplan.data.DomainDataset) -> None

  2. collect(self: _wlplan.feature_generator.Features, graphs: list[_wlplan.graph_generator.Graph]) -> None

embed(*args, **kwargs)

Overloaded function.

  1. embed(self: _wlplan.feature_generator.Features, dataset: _wlplan.data.DomainDataset) -> list[list[float]]

  2. embed(self: _wlplan.feature_generator.Features, graphs: list[_wlplan.graph_generator.Graph]) -> list[list[float]]

  3. embed(self: _wlplan.feature_generator.Features, graph: _wlplan.graph_generator.Graph) -> list[float]

  4. embed(self: _wlplan.feature_generator.Features, state: _wlplan.planning.State) -> list[float]

get_colour_to_layer(self: _wlplan.feature_generator.Features) dict[int, int]
get_feature_name(self: _wlplan.feature_generator.Features) str
get_graph_representation(self: _wlplan.feature_generator.Features) str
get_iterations(self: _wlplan.feature_generator.Features) int
get_layer_to_colours(self: _wlplan.feature_generator.Features) list[set[int]]
get_layer_to_n_colours(self: _wlplan.feature_generator.Features) list[int]
get_n_colours(self: _wlplan.feature_generator.Features) int
get_n_features(self: _wlplan.feature_generator.Features) int
get_pruning(self: _wlplan.feature_generator.Features) str
get_seen_counts(self: _wlplan.feature_generator.Features) list[int]
get_string_representation(*args, **kwargs)

Overloaded function.

  1. get_string_representation(self: _wlplan.feature_generator.Features, embedding: list[float]) -> str

  2. get_string_representation(self: _wlplan.feature_generator.Features, state: _wlplan.planning.State) -> str

get_unseen_counts(self: _wlplan.feature_generator.Features) list[int]
get_weights(self: _wlplan.feature_generator.Features) list[float]
predict(*args, **kwargs)

Overloaded function.

  1. predict(self: _wlplan.feature_generator.Features, graph: _wlplan.graph_generator.Graph) -> float

  2. predict(self: _wlplan.feature_generator.Features, state: _wlplan.planning.State) -> float

print_init_colours(self: _wlplan.feature_generator.Features) None
save(*args, **kwargs)

Overloaded function.

  1. save(self: _wlplan.feature_generator.Features, filename: str) -> None

  2. save(self: _wlplan.feature_generator.Features, filename: str, weights: list[float]) -> None

set_problem(self: _wlplan.feature_generator.Features, problem: _wlplan.planning.Problem) None
set_pruning(self: _wlplan.feature_generator.Features, pruning: str) None
set_weights(self: _wlplan.feature_generator.Features, weights: list[float]) None
to_graphs(self: _wlplan.feature_generator.Features, dataset: _wlplan.data.DomainDataset) list[_wlplan.graph_generator.Graph]
get_available_feature_generators() list[str]
get_available_graph_generators() list[str]
get_available_pruning_methods() list[str]
init_feature_generator(feature_algorithm: str, domain: Domain, graph_representation: str = 'ilg', iterations: int = 2, pruning: str = 'none', multiset_hash: bool = False) Features

Returns a feature generator based on the specified feature algorithm.

Parameters:
  • feature_algorithm (str) – The WL feature algorithm to use.

  • domain (Domain) – The input domain.

  • graph_representation (str, default="ilg") – The graph encoding of planning states used. If “custom”, the user can only call class method of classes and not datasets and states.

  • iterations (int, default=2) – The number of WL iterations to perform.

  • pruning (str, default="none") – How to detect and prune duplicate features. If “none”, no pruning is done.

  • multiset_hash (bool, default=False) – Choose to use either set or multiset to store neighbour colours.

Returns:

FeatureGenerator

Return type:

The instantiated feature generator.

Raises:

ValueError – If a specified argument is unknown.: