d3m.primitive_interfaces.transformer module

class d3m.primitive_interfaces.transformer.TransformerPrimitiveBase(*, hyperparams, random_seed=0, docker_containers=None, volumes=None, temporary_directory=None)[source]

Bases: d3m.primitive_interfaces.base.PrimitiveBase[[typing.Inputs, typing.Outputs, None], typing.Hyperparams]

A base class for primitives which are not fitted at all and can simply produce (useful) outputs from inputs directly. As such they also do not have any state (params).

This class is parameterized using only three type variables, Inputs, Outputs, and Hyperparams.

metadata[source]

Primitive’s metadata. Available as a class attribute.

Type

ClassVar[d3m.metadata.base.PrimitiveMetadata]

Type

ClassVar[PrimitiveMetadata]

logger[source]

Primitive’s logger. Available as a class attribute.

Type

ClassVar[logging.Logger]

Type

ClassVar[Logger]

hyperparams[source]

Hyperparams passed to the constructor.

Type

Hyperparams

Type

~Hyperparams

random_seed[source]

Random seed passed to the constructor.

Type

int

Type

int

docker_containers[source]

A dict mapping Docker image keys from primitive’s metadata to (named) tuples containing container’s address under which the container is accessible by the primitive, and a dict mapping exposed ports to ports on that address.

Type

Dict[str, d3m.primitive_interfaces.base.DockerContainer]

Type

Dict[str, DockerContainer]

volumes[source]

A dict mapping volume keys from primitive’s metadata to file and directory paths where downloaded and extracted files are available to the primitive.

Type

Dict[str, str]

Type

Dict[str, str]

temporary_directory[source]

An absolute path to a temporary directory a primitive can use to store any files for the duration of the current pipeline run phase. Directory is automatically cleaned up after the current pipeline run phase finishes.

Type

str

Type

str

docker_containers: Dict[str, d3m.primitive_interfaces.base.DockerContainer][source]
fit(*, timeout=None, iterations=None)[source]

A noop.

Parameters
  • timeout (Optional[float]) – A maximum time this primitive should be fitting during this method call, in seconds.

  • iterations (Optional[int]) – How many of internal iterations should the primitive do.

Returns

A CallResult with None value.

Return type

CallResult[None]

fit_multi_produce(*, produce_methods, inputs, timeout=None, iterations=None)[source]

A method calling fit and after that multiple produce methods at once.

Parameters
  • produce_methods (Sequence[str]) – A list of names of produce methods to call.

  • inputs (~Inputs) – The inputs given to all produce methods.

  • timeout (Optional[float]) – A maximum time this primitive should take to both fit the primitive and produce outputs for all produce methods listed in produce_methods argument, in seconds.

  • iterations (Optional[int]) – How many of internal iterations should the primitive do for both fitting and producing outputs of all produce methods.

Returns

A dict of values for each produce method wrapped inside MultiCallResult.

Return type

MultiCallResult

get_params()[source]

A noop.

Returns

An instance of parameters.

Return type

None

hyperparams: Hyperparams[source]
random_seed: int[source]
set_params(*, params)[source]

A noop.

Parameters

params (None) – An instance of parameters.

Return type

None

set_training_data()[source]

A noop.

Return type

None

temporary_directory: str[source]
volumes: Dict[str, str][source]