Note

This is the documentation for the current state of the development branch of Qiskit Experiments. The documentation or APIs here can change prior to being released.

BaseDiscriminator

class BaseDiscriminator[source]

An abstract base class for serializable discriminators used in the DiscriminatorNode data action nodes.

This class allows developers to implement their own discriminators or wrap discriminators from external libraries which therefore ensures that the discriminator fits in the data processing chain. This class defines an interface for discriminator objects. Subclasses must implement the following methods:

  • predict(): called in the Discriminator data-action class to predict labels from the input level-one data.

  • config(): produces the config file to serialize and deserialize the discriminator.

  • is_trained(): indicates if the discriminator is trained, i.e., fit to training data.

Attributes

BaseDiscriminator.discriminator

Return the discriminator object that is wrapped.

Methods

BaseDiscriminator.config()

Return the configuration of the discriminator.

BaseDiscriminator.from_config(config)

Create a discriminator from the configuration.

BaseDiscriminator.is_trained()

Return True if this discriminator has been trained on data.

BaseDiscriminator.predict(data)

The function used to predict the labels of the data.