weka.flow package

weka.flow.container module

class weka.flow.container.AttributeSelectionContainer(original=None, reduced=None, num_atts=None, selected=None, results=None)

Bases: Container

Container for models.

is_valid()

Checks whether the container is valid.

Returns:

True if the container is valid

Return type:

bool

class weka.flow.container.ClassificationContainer(inst=None, classification=None, label=None, distribution=None)

Bases: Container

Container for predictions (classifiers).

is_valid()

Checks whether the container is valid.

Returns:

True if the container is valid

Return type:

bool

class weka.flow.container.ClusteringContainer(inst=None, cluster=None, distribution=None)

Bases: Container

Container for predictions (clusterers).

is_valid()

Checks whether the container is valid.

Returns:

True if the container is valid

Return type:

bool

class weka.flow.container.ModelContainer(model=None, header=None)

Bases: Container

Container for models.

is_valid()

Checks whether the container is valid.

Returns:

True if the container is valid

Return type:

bool

weka.flow.conversion module

class weka.flow.conversion.AnyToCommandline(config=None)

Bases: Conversion

Generates a commandline string, e.g., from a classifier.

convert()

Performs the actual conversion.

Returns:

None if successful, otherwise errors message

Return type:

str

description()

Returns the description for the conversion.

Returns:

the description

Return type:

str

class weka.flow.conversion.CommandlineToAny(config=None)

Bases: Conversion

Generates an object from a commandline string, e.g., from a classifier setup.

check_input(obj)

Performs checks on the input object. Raises an exception if unsupported.

Parameters:

obj (object) – the object to check

convert()

Performs the actual conversion.

Returns:

None if successful, otherwise errors message

Return type:

str

description()

Returns the description for the conversion.

Returns:

the description

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

weka.flow.sink module

class weka.flow.sink.ClassifierErrors(name=None, config=None)

Bases: Sink

Displays the errors obtained through a classifier evaluation.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.sink.InstanceDumper(name=None, config=None)

Bases: FileOutputSink

Sink that dumps the incoming Instance/Instances into a file.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

class weka.flow.sink.LinePlot(name=None, config=None)

Bases: Sink

Displays the Instances object as line plot using the internal format, one line per Instance.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.sink.MatrixPlot(name=None, config=None)

Bases: Sink

Displays the Instances object as matrix plot.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.sink.ModelWriter(name=None, config=None)

Bases: FileOutputSink

Writes a model to disk.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

class weka.flow.sink.PRC(name=None, config=None)

Bases: Sink

Displays the PRC curve obtained from a classifier evaluation.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.sink.ROC(name=None, config=None)

Bases: Sink

Displays the ROC curve obtained from a classifier evaluation.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

weka.flow.source module

class weka.flow.source.DataGenerator(name=None, config=None)

Bases: Source

Generates artificial data using the specified data generator.

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

from_config(k, v)

Hook method that allows converting values from the dictionary.

Parameters:
  • k (str) – the key in the dictionary

  • v (object) – the value

Returns:

the potentially parsed value

Return type:

object

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

to_config(k, v)

Hook method that allows conversion of individual options.

Parameters:
  • k (str) – the key of the option

  • v (object) – the value

Returns:

the potentially processed value

Return type:

object

class weka.flow.source.LoadDatabase(name=None, config=None)

Bases: Source

Loads a dataset from the database.

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

weka.flow.transformer module

class weka.flow.transformer.AttributeSelection(name=None, config=None)

Bases: Transformer

Performs attribute selection on the incoming dataset using the specified search and evaluation scheme. Outputs a AttributeSelectionContainer with the results string, reduced dataset and seleted attributes.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.ClassSelector(name=None, config=None)

Bases: Transformer

Sets/unsets the class index of a dataset.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.Copy(name=None, config=None)

Bases: Transformer

Creates a deep copy of the token passing through (must be a serializable JavaObject), other objects just get passed on.

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

class weka.flow.transformer.CrossValidate(name=None, config=None)

Bases: Transformer

Cross-validates the classifier/clusterer on the incoming dataset. In case of a classifier, the Evaluation object is forwarded. For clusterers the loglikelihood.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.Evaluate(name=None, config=None)

Bases: Transformer

Evaluates a trained classifier obtained from internal storage on the dataset passing through.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.EvaluationSummary(name=None, config=None)

Bases: Transformer

Generates a summary string from an Evaluation/ClusterEvaluation object.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.Filter(name=None, config=None)

Bases: Transformer

Filters a dataset with the specified filter setup. Automatically resets the filter if the dataset differs.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.LoadDataset(name=None, config=None)

Bases: Transformer

Loads a dataset from a file.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

has_output()

Checks whether any output tokens are present.

Returns:

true if at least one output token present

Return type:

bool

output()

Returns the next available output token.

Returns:

the next token, None if none available

Return type:

Token

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

stop_execution()

Triggers the stopping of the object.

wrapup()

Finishes up after execution finishes, does not remove any graphical output.

class weka.flow.transformer.ModelReader(name=None, config=None)

Bases: Transformer

Reads the serialized model (Classifier/Clusterer) from disk and forwards a ModelContainer.

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

class weka.flow.transformer.Predict(name=None, config=None)

Bases: Transformer

Uses the serialized model or, if pointing to a directory, the specified model from storage for making a prediction on the incoming Instance object. The model can be either a Classifier or Clusterer. Outputs either a ClassificationContainer or ClusteringContainer.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.RenameRelation(name=None, config=None)

Bases: Transformer

Updates the relation name of Instance/Instances objects passing through.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.SetStorageValue(name=None, config=None)

Bases: Transformer

Store the payload of the current token in internal storage using the specified name.

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

class weka.flow.transformer.Train(name=None, config=None)

Bases: Transformer

Trains the classifier/clusterer/associator on the incoming dataset and forwards a ModelContainer with the trained model and the dataset header.

check_input(token)

Performs checks on the input token. Raises an exception if unsupported.

Parameters:

token (Token) – the token to check

description()

Returns a description of the actor.

Returns:

the description

Return type:

str

do_execute()

The actual execution of the actor.

Returns:

None if successful, otherwise error message

Return type:

str

fix_config(options)

Fixes the options, if necessary. I.e., it adds all required elements to the dictionary.

Parameters:

options (dict) – the options to fix

Returns:

the (potentially) fixed options

Return type:

dict

property quickinfo

Returns a short string describing some of the options of the actor.

Returns:

the info, None if not available

Return type:

str

Module contents