Bases: weka.core.classes.JavaObject
Wrapper for Capabilities.
Returns all the attribute capabilities.
Returns: | attribute capabilities |
---|---|
Return type: | Capabilities |
Returns all the capabilities.
Returns: | all capabilities |
---|---|
Return type: | list |
Returns all the class capabilities.
Returns: | class capabilities |
---|---|
Return type: | Capabilities |
Returns all the dependencies.
Returns: | the dependency list |
---|---|
Return type: | list |
Disables the specified capability.
Parameters: | capability (Capability) – the capability to disable |
---|
Disables all capabilities.
Disables all attribute dependencies.
Disables all attributes.
Disables all class dependencies.
Disables all classes.
Disables the dependency of the given capability Disabling NOMINAL_ATTRIBUTES also disables BINARY_ATTRIBUTES, UNARY_ATTRIBUTES and EMPTY_NOMINAL_ATTRIBUTES.
Parameters: | capability (Capability) – the dependency to disable |
---|
enables the specified capability.
Parameters: | capability (Capability) – the capability to enable |
---|
enables all capabilities.
enables all attribute dependencies.
enables all attributes.
enables all class dependencies.
enables all classes.
enables the dependency of the given capability enabling NOMINAL_ATTRIBUTES also enables BINARY_ATTRIBUTES, UNARY_ATTRIBUTES and EMPTY_NOMINAL_ATTRIBUTES.
Parameters: | capability (Capability) – the dependency to enable |
---|
returns a Capabilities object specific for this data. The minimum number of instances is not set, the check for multi-instance data is optional.
Parameters: |
|
---|---|
Returns: | the generated capabilities |
Return type: | Capabilities |
Returns whether the specified capability is set.
Parameters: | capability (Capability) – the capability to check |
---|---|
Returns: | whether the capability is set |
Return type: | bool |
Returns whether any dependencies are set.
Returns: | whether any dependecies are set |
---|---|
Return type: | bool |
Returns whether the specified dependency is set.
Parameters: | capability (Capability) – the capability to check |
---|---|
Returns: | whether the dependency is set |
Return type: | bool |
Returns the minimum number of instances that must be supported.
Returns: | the minimum number |
---|---|
Return type: | int |
Returns all other capabilities.
Returns: | all other capabilities |
---|---|
Return type: | Capabilities |
Returns the owner of these capabilities, if any.
Returns: | the owner, can be None |
---|---|
Return type: | JavaObject |
Returns true if the currently set capabilities support at least all of the capabiliites of the given Capabilities object (checks only the enum!)
Parameters: | capabilities (Capabilities) – the capabilities to check |
---|---|
Returns: | whether the current capabilities support at least the specified ones |
Return type: | bool |
Returns true if the currently set capabilities support (or have a dependency) at least all of the capabilities of the given Capabilities object (checks only the enum!)
Parameters: | capabilities (Capabilities) – the capabilities to check |
---|---|
Returns: | whether the current capabilities (potentially) support the specified ones |
Return type: | bool |
Tests whether the attribute meets the conditions.
Parameters: |
|
---|---|
Returns: | whether the attribute meets the conditions |
Return type: | bool |
Tests whether the dataset meets the conditions.
Parameters: |
|
---|---|
Returns: | wether the dataset meets the requirements |
Return type: | bool |
Bases: weka.core.classes.Enum
Wrapper for a Capability.
Returns whether this capability is an attribute.
Returns: | whether it is an attribute |
---|---|
Return type: | bool |
Returns whether this capability is an attribute capability.
Returns: | whether it is an attribute capability |
---|---|
Return type: | bool |
Returns whether this capability is a class.
Returns: | whether it is a class |
---|---|
Return type: | bool |
Returns whether this capability is a class capability.
Returns: | whether it is a class capability |
---|---|
Return type: | bool |
Returns whether this capability is an other capability.
Returns: | whether it is an other capability |
---|---|
Return type: | bool |
Bases: weka.core.classes.OptionHandler
Ancestor for all parameter classes used by SetupGenerator and MultiSearch.
Returns the currently set property to apply the parameter to.
Returns: | the property |
---|---|
Return type: | str |
Bases: weka.core.classes.JSONObject
The ancestor for all actors.
Obtains the currently set options of the actor.
Returns: | the options |
---|---|
Return type: | dict |
Returns a description of the object.
Returns: | the description |
---|---|
Return type: | str |
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 |
Restores its state from a dictionary, used in de-JSONification.
Parameters: | d (dict) – the object dictionary |
---|
Generates a help string for this actor.
Returns: | the help string |
---|---|
Return type: | str |
Obtains the help information per option for this actor.
Returns: | the help |
---|---|
Return type: | dict |
Returns the logger object.
Returns: | the logger |
---|---|
Return type: | logger |
Returns a new logger instance.
Returns: | the logger instance |
---|---|
Return type: | logger |
Prints a help string for this actor to stdout.
Returns a dictionary that represents this object, to be used for JSONification.
Returns: | the object dictionary |
---|---|
Return type: | dict |
Bases: weka.core.classes.JavaObject
Wrapper for Java enums.
Returns the name of the enum member.
Returns: | the name |
---|---|
Return type: | str |
Returns the ordinal of the enum member.
Returns: | the ordinal |
---|---|
Return type: | int |
Returns list of all enum members.
Returns: | all enum members |
---|---|
Return type: | list |
Bases: object
Ancestor for classes that can be represented as JSON and restored from JSON.
Restores an object state from a dictionary, used in de-JSONification.
Parameters: | d (dict) – the object dictionary |
---|---|
Returns: | the object |
Return type: | object |
Restores the object from the given JSON.
Parameters: | s (str) – the JSON string to parse |
---|---|
Returns: | the |
Returns a shallow copy of itself.
Returns: | the copy |
---|---|
Return type: | object |
Returns a dictionary that represents this object, to be used for JSONification.
Returns: | the object dictionary |
---|---|
Return type: | dict |
Returns the options as JSON.
Returns: | the object as string |
---|---|
Return type: | str |
Bases: weka.core.classes.JavaObject
Convenience wrapper around Java arrays.
Creates a new array with the given classname and length; initial values are null.
Parameters: |
|
---|---|
Returns: | the Java array |
Return type: | JB_Object |
Bases: object
Iterator for elements in a Java array.
Bases: weka.core.classes.JSONObject
Basic Java object.
Returns whether the object implements the specified interface or is a subclass. E.g.: self._check_type(‘weka.core.OptionHandler’, ‘Lweka/core/OptionHandler;’) or self._check_type(‘weka.core.converters.AbstractFileLoader’)
Parameters: |
|
---|---|
Returns: | whether object implements interface or is subclass |
Return type: | bool |
Returns the Java classname in dot-notation.
Returns: | the Java classname |
---|---|
Return type: | str |
Raises an exception if the object does not implement the specified interface or is not a subclass. E.g.: self._enforce_type(‘weka.core.OptionHandler’, ‘Lweka/core/OptionHandler;’) or self._enforce_type(‘weka.core.converters.AbstractFileLoader’)
Parameters: |
|
---|
Restores an object state from a dictionary, used in de-JSONification.
Parameters: | d (dict) – the object dictionary |
---|---|
Returns: | the object |
Return type: | object |
Attempts to get the value (jobject, a Java object) of the provided (bean) property path.
Parameters: | path (str) – the property path, e.g., “filter” for a setFilter(...)/getFilter() method pair |
---|---|
Returns: | the wrapped Java object |
Return type: | JavaObject |
Returns true if the object is serialiable.
Returns: | true if serializable |
---|---|
Return type: | bool |
Returns the Java class object of the underlying Java object.
Returns: | the Java class |
---|---|
Return type: | JB_Object |
Returns a JClassWrapper instance of the class for the encapsulated Java object, giving access to the class methods using dot notation.
http://pythonhosted.org//javabridge/highlevel.html#wrapping-java-objects-using-reflection
Returns: | the wrapper |
---|---|
Return type: | JClassWrapper |
Returns a JWrapper instance of the encapsulated Java object, giving access to methods using dot notation.
http://pythonhosted.org//javabridge/highlevel.html#wrapping-java-objects-using-reflection
Returns: | the wrapper |
---|---|
Return type: | JWrapper |
Creates a new object from the given classname using the default constructor, None in case of error.
Parameters: |
|
---|---|
Returns: | the Java object |
Return type: | JB_Object |
Attempts to set the value (jobject, a Java object) of the provided (bean) property path.
Parameters: |
|
---|
Returns a dictionary that represents this object, to be used for JSONification.
Returns: | the object dictionary |
---|---|
Return type: | dict |
Bases: weka.core.classes.AbstractParameter
Parameter using a predefined list of values, used by SetupGenerator and MultiSearch.
Returns the currently set values.
Returns: | the list of values (strings) |
---|---|
Return type: | list |
Bases: weka.core.classes.AbstractParameter
Parameter using a math expression for generating values, used by SetupGenerator and MultiSearch.
Returns the currently set base value.
Returns: | the base |
---|---|
Return type: | float |
Returns the currently set expression.
Returns: | the expression |
---|---|
Return type: | str |
Returns the currently set maximum value.
Returns: | the maximum |
---|---|
Return type: | float |
Returns the currently set minimum value.
Returns: | the minimum |
---|---|
Return type: | float |
Returns the currently set step value.
Returns: | the step |
---|---|
Return type: | float |
Bases: weka.core.classes.JavaObject
Wrapper for the weka.core.Option class.
Returns the description of the option.
Returns: | the description |
---|---|
Return type: | str |
Returns the name of the option.
Returns: | the name |
---|---|
Return type: | str |
Returns the synopsis of the option.
Returns: | the synopsis |
---|---|
Return type: | str |
Returns the synopsis of the option.
Returns: | the synopsis |
---|---|
Return type: | str |
Bases: weka.core.classes.JavaObject, weka.core.classes.Configurable
Ancestor for option-handling classes. Classes should implement the weka.core.OptionHandler interface to have any effect.
Returns a description of the object.
Returns: | the description |
---|---|
Return type: | str |
Restores an object state from a dictionary, used in de-JSONification.
Parameters: | d (dict) – the object dictionary |
---|---|
Returns: | the object |
Return type: | object |
Returns the globalInfo() result, None if not available.
Rtypes: | str |
---|
Obtains the currently set options as list.
Returns: | the list of options |
---|---|
Return type: | list |
Generates a commandline string from the JavaObject instance.
Returns: | the commandline string |
---|---|
Return type: | str |
Returns a dictionary that represents this object, to be used for JSONification.
Returns: | the object dictionary |
---|---|
Return type: | dict |
Returns a string that contains the ‘global_info’ text and the options.
Returns: | the generated help string |
---|---|
Return type: | str |
Bases: weka.core.classes.JavaObject
Wrapper for the java.util.Random class.
Next random double.
Returns: | the next random double |
---|---|
Return type: | double |
Next random integer. if n is provided, then between 0 and n-1.
Parameters: | n (int) – the upper limit (minus 1) for the random integer |
---|---|
Returns: | the next random integer |
Return type: | int |
Bases: weka.core.classes.JavaObject
Wrapper for a Weka Range object.
Returns whether the range is inverted.
Returns: | true if inverted |
---|---|
Return type: | bool |
Returns the string range.
Returns: | the string range of 1-based indices |
---|---|
Return type: | str |
Returns the selection list.
Returns: | the list of 0-based integer indices |
---|---|
Return type: | list |
Sets the upper limit.
Parameters: | upper (int) – the upper limit |
---|
Bases: weka.core.classes.JavaObject
Wrapper for the weka.core.SelectedTag class.
Returns the selected tag.
Returns: | the tag |
---|---|
Return type: | Tag |
Returns the associated tags.
Returns: | the list of Tag objects |
---|---|
Return type: | list |
Bases: weka.core.classes.OptionHandler
Allows generation of large number of setups using parameter setups.
Returns the base object to apply the setups to.
Returns: | the base object |
---|---|
Return type: | JavaObject or OptionHandler |
Returns the list of currently set search parameters.
Returns: | the list of AbstractSearchParameter objects |
---|---|
Return type: | list |
Generates and returns all the setups according to the parameter search space.
Returns: | the list of configured objects (of type JavaObject) |
---|---|
Return type: | list |
Bases: weka.core.classes.JavaObject
Wrapper for a Weka SingleIndex object.
Returns the integer index.
Returns: | the 0-based integer index |
---|---|
Return type: | int |
Returns the string index.
Returns: | the 1-based string index |
---|---|
Return type: | str |
Sets the upper limit.
Parameters: | upper (int) – the upper limit |
---|
Bases: object
Classes that can be stopped.
Returns whether the object has been stopped.
Returns: | whether stopped |
---|---|
Return type: | bool |
Triggers the stopping of the object.
Bases: weka.core.classes.JavaObject
Wrapper for the weka.core.Tag class.
Returns the current integer ID of the tag.
Returns: | the integer ID |
---|---|
Return type: | int |
Returns the current ID string.
Returns: | the ID string |
---|---|
Return type: | str |
Returns the ‘human readable’ string.
Returns: | the readable string |
---|---|
Return type: | str |
Bases: weka.core.classes.JavaObject
Wrapper for an array of weka.core.Tag objects.
Returns the Tag that matches the name.
Parameters: | name (str) – the string representation of the tag |
---|---|
Returns: | the tag, None if not found |
Return type: | Tag |
Instantiates the Tag array obtained from the object using the specified method name.
Example: cls = Classifier(classname=”weka.classifiers.meta.MultiSearch”) tags = Tags.get_object_tags(cls, “getMetricsTags”)
Parameters: |
|
---|---|
Returns: | the Tags objects |
Return type: | Tags |
Instantiates the Tag array located in the specified class with the given field name.
Example: tags = Tags.get_tags(“weka.classifiers.functions.SMO”, “TAGS_FILTER”)
Parameters: |
|
---|---|
Returns: | the Tags objects |
Return type: | Tags |
Backquotes the string.
Parameters: | s (str) – the string to process |
---|---|
Returns: | the backquoted string |
Return type: | str |
Deregisters a handler for restoring an object from a JSON dictionary.
Parameters: | typestr (str) – the type of the object |
---|
Creates an OptionHandler based on the provided commandline string.
Parameters: |
|
---|---|
Returns: | the generated option handler instance |
Return type: | object |
The methods that handle the restoration from a JSON dictionary, stored under their ‘type’.
Returns the class object associated with the dot-notation classname.
Taken from here: http://stackoverflow.com/a/452981
Parameters: | classname (str) – the classname |
---|---|
Returns: | the class object |
Return type: | object |
Returns the classname of the JB_Object, Python class or object.
Parameters: | obj (object) – the java object or Python class/object to get the classname for |
---|---|
Returns: | the classname |
Return type: | str |
Returns the handler for restoring an object from a JSON dictionary.
Parameters: | typestr (str) – the type of the object |
---|---|
Returns: | the handler, None if not available |
Returns the Java class object associated with the dot-notation classname.
Parameters: | classname (str) – the classname |
---|---|
Returns: | the class object |
Return type: | JB_Object |
Returns the handler for restoring an object from a JSON dictionary.
Parameters: | typestr (str) – the type of the object |
---|---|
Returns: | the handler, None if not available |
Turns the list of options back into a single commandline string.
Parameters: | options (list) – the list of options to process |
---|---|
Returns: | the combined options |
Return type: | str |
Runs a classifier from the command-line. Calls JVM start/stop automatically. Use -h to see all options.
Quotes the string if necessary.
Parameters: | s (str) – the string to process |
---|---|
Returns: | the quoted string |
Return type: | str |
Registers a handler for restoring an object from a JSON dictionary.
Parameters: |
|
---|
Splits the commandline into a list of options.
Parameters: | cmdline (str) – the commandline string to split into individual options |
---|---|
Returns: | the split list of commandline options |
Return type: | list |
Generates a commandline string from the OptionHandler instance.
Parameters: | optionhandler (OptionHandler) – the OptionHandler instance to turn into a commandline |
---|---|
Returns: | the commandline string |
Return type: | str |
Un-backquotes the string.
Parameters: | s (str) – the string to process |
---|---|
Returns: | the un-backquoted string |
Return type: | str |
Un-quotes the string.
Parameters: | s (str) – the string to process |
---|---|
Returns: | the un-quoted string |
Return type: | str |
Bases: object
Iterator for dataset rows when loarding incrementally.
Bases: weka.core.classes.OptionHandler
Wrapper class for Loaders.
Loads the specified file and returns the Instances object. In case of incremental loading, only the structure.
Parameters: |
|
---|---|
Returns: | the full dataset or the header (if incremental) |
Return type: | Instances |
Raises Exception: | |
if the file does not exist |
Loads the specified URL and returns the Instances object. In case of incremental loading, only the structure.
Parameters: |
|
---|---|
Returns: | the full dataset or the header (if incremental) |
Return type: | Instances |
Bases: weka.core.classes.OptionHandler
Wrapper class for Savers.
Returns the capabilities of the saver.
Returns: | the capabilities |
---|---|
Return type: | Capabilities |
Saves the Instances object in the specified file.
Parameters: |
|
---|
Bases: weka.core.classes.OptionHandler
Wrapper class for TextDirectoryLoader.
Loads the text files from the specified directory and returns the Instances object. In case of incremental loading, only the structure.
Returns: | the full dataset or the header (if incremental) |
---|---|
Return type: | Instances |
Determines a Loader based on the the file extension. If successful, loads the full dataset and returns it.
Parameters: | filename (str) – the name of the file to load |
---|---|
Returns: | the |
Return type: | Instances |
Returns a Loader that can load the specified file, based on the file extension. None if failed to determine.
Parameters: | filename (str) – the filename to get the loader for |
---|---|
Returns: | the assoicated loader instance or None if none found |
Return type: | Loader |
Converts the numpy matrix into an Instances object and returns it.
Parameters: |
|
---|---|
Returns: | the generated instances object |
Return type: | Instances |
Determines a Saver based on the the file extension. Returns whether successfully saved.
Parameters: |
|
---|---|
Returns: | whether successfully saved |
Return type: | bool |
Returns a Saver that can load the specified file, based on the file extension. None if failed to determine.
Parameters: | filename (str) – the filename to get the saver for |
---|---|
Returns: | the associated saver instance or None if none found |
Return type: | Saver |
Bases: weka.core.classes.OptionHandler
Wrapper class for weka.experiment.DatabaseUtils.
Obtains the currently set database URL.
Returns: | the database URL |
---|---|
Return type: | str |
Obtains the currently set database password.
Returns: | the database password |
---|---|
Return type: | str |
Obtains the currently set database user.
Returns: | the database user |
---|---|
Return type: | str |
Bases: weka.core.database.DatabaseUtils
Wrapper class for weka.experiment.InstanceQuery.
Obtains the currently set custom properties file.
Returns: | the custom properties file |
---|---|
Return type: | str |
Obtains the current SQL query to execute.
Returns: | the SQL query |
---|---|
Return type: | str |
Executes either the supplied query or the one set via options (or the ‘query’ property).
Parameters: | query (str) – query to execute if not the currently set one |
---|---|
Returns: | the generated dataq |
Return type: | Instances |
Obtains the whether sparse data is returned or not.
Returns: | whether sparse data is generated |
---|---|
Return type: | bool |
Bases: weka.core.classes.JavaObject
Wrapper class for weka.core.Attribute.
Adds the relation value, returns the index.
Parameters: | instances (Instances) – the Instances object to add |
---|---|
Returns: | the index |
Return type: | int |
Adds the string value, returns the index.
Parameters: | s (str) – the string to add |
---|---|
Returns: | the index |
Return type: | int |
Creates a copy of this attribute.
Parameters: | name (str) – the new name, uses the old one if None |
---|---|
Returns: | the copy of the attribute |
Return type: | Attribute |
Creates a date attribute.
Parameters: |
|
---|
Creates a nominal attribute.
Parameters: |
|
---|
Creates a numeric attribute.
Parameters: | name (str) – the name of the attribute |
---|
Creates a relational attribute.
Parameters: |
|
---|
Creates a string attribute.
Parameters: | name (str) – the name of the attribute |
---|
Returns the format of this data attribute. See java.text.SimpleDateFormat Javadoc.
Returns: | the format string |
---|---|
Return type: | str |
Checks whether this attributes is the same as the provided one.
Parameters: | att (Attribute) – the Attribute to check against |
---|---|
Returns: | whether the same |
Return type: | bool |
Checks whether this attributes is the same as the provided one. Returns None if the same, otherwise error message.
Parameters: | att (Attribute) – the Attribute to check against |
---|---|
Returns: | None if the same, otherwise error message |
Return type: | str |
Returns the index of this attribute.
Returns: | the index |
---|---|
Return type: | int |
Returns the index of the label in this attribute.
Parameters: | label (str) – the string label to get the index for |
---|---|
Returns: | the 0-based index |
Return type: | int |
Returns whether the attribute is averagable.
Returns: | whether averagable |
---|---|
Return type: | bool |
Returns whether the attribute is a date one.
Returns: | whether date attribute |
---|---|
Return type: | bool |
Checks whether the value is within the bounds of the numeric attribute.
Parameters: | value (float) – the numeric value to check |
---|---|
Returns: | whether between lower and upper bound |
Return type: | bool |
Returns whether the attribute is a nominal one.
Returns: | whether nominal attribute |
---|---|
Return type: | bool |
Returns whether the attribute is a numeric one (date or numeric).
Returns: | whether numeric attribute |
---|---|
Return type: | bool |
Returns whether the attribute is a relation valued one.
Returns: | whether relation valued attribute |
---|---|
Return type: | bool |
Returns whether the attribute is a string attribute.
Returns: | whether string attribute |
---|---|
Return type: | bool |
Returns the lower numeric bound of the numeric attribute.
Returns: | the lower bound |
---|---|
Return type: | float |
Returns the name of the attribute.
Returns: | the name |
---|---|
Return type: | str |
Returns the number of labels.
Returns: | the number of labels |
---|---|
Return type: | int |
Returns the ordering of the attribute.
Returns: | the ordering (ORDERING_SYMBOLIC, ORDERING_ORDERED, ORDERING_MODULO) |
---|---|
Return type: | int |
Parses the date string and returns the internal format value.
Parameters: | s (str) – the date string |
---|---|
Returns: | the internal format |
Return type: | float |
Returns the type of the attribute. See weka.core.Attribute Javadoc.
Returns: | the type |
---|---|
Return type: | int |
Returns the type of the attribute as string.
Returns: | the type |
---|---|
Return type: | str |
Returns the upper numeric bound of the numeric attribute.
Returns: | the upper bound |
---|---|
Return type: | float |
Returns the label for the index.
Parameters: | index (int) – the 0-based index of the label to return |
---|---|
Returns: | the label |
Return type: | str |
Returns the labels, strings or relation-values.
Returns: | all the values, None if not NOMINAL, STRING, or RELATION |
---|---|
Return type: | list |
Returns the weight of the attribute.
Returns: | the weight |
---|---|
Return type: | float |
Bases: object
Iterator for attributes in an Instances object.
Bases: weka.core.classes.JavaObject
Container for attribute statistics.
The number of distinct values.
Returns: | The number of distinct values |
---|---|
Return type: | int |
The number of int-like values.
Returns: | The number of int-like values |
---|---|
Return type: | int |
The number of missing values.
Returns: | The number of missing values |
---|---|
Return type: | int |
Counts of each nominal value.
Returns: | Counts of each nominal value |
---|---|
Return type: | ndarray |
Weight mass for each nominal value.
Returns: | Weight mass for each nominal value |
---|---|
Return type: | ndarray |
Stats on numeric value distributions.
Returns: | Stats on numeric value distributions |
---|---|
Return type: | NumericStats |
The total number of values.
Returns: | The total number of values |
---|---|
Return type: | int |
The number of values that only appear once.
Returns: | The number of values that only appear once |
---|---|
Return type: | int |
Bases: weka.core.classes.JavaObject
Wrapper class for weka.core.Instance.
Returns the currently set class attribute.
Returns: | the class attribute |
---|---|
Return type: | Attribute |
Returns the currently set class index.
Returns: | the class index, -1 if not set |
---|---|
Return type: | int |
Creates a new instance.
Parameters: |
|
---|
Creates a new sparse instance.
Parameters: |
|
---|
Returns the dataset that this instance belongs to.
Returns: | the dataset or None if no dataset set |
---|---|
Return type: | Instances |
Returns the relational value at the specified position (0-based).
Parameters: | index (int) – the 0-based index of the inernal value |
---|---|
Returns: | the relational value |
Return type: | Instances |
Returns the string value at the specified position (0-based).
Parameters: | index (int) – the 0-based index of the inernal value |
---|---|
Returns: | the string value |
Return type: | str |
Returns the internal value at the specified position (0-based).
Parameters: | index (int) – the 0-based index of the inernal value |
---|---|
Returns: | the internal value |
Return type: | float |
Returns whether a class attribute is set (convenience method).
Returns: | whether a class attribute is currently set |
---|---|
Return type: | bool |
Returns whether at least one attribute has a missing value.
Returns: | whether at least one value is missing |
---|---|
Return type: | bool |
Returns whether the attribute at the specified index is missing.
Parameters: | index (int) – the 0-based index of the attribute |
---|---|
Returns: | whether the value is missing |
Return type: | bool |
Returns the numeric value that represents a missing value in Weka (NaN).
Returns: | missing value |
---|---|
Return type: | float |
Returns the number of attributes.
Returns: | the numer of attributes |
---|---|
Return type: | int |
Returns the number of class labels.
Returns: | the numer of class labels |
---|---|
Return type: | int |
Sets the attribute at the specified index to missing.
Parameters: | index (int) – the 0-based index of the attribute |
---|
Sets the string value at the specified position (0-based).
Parameters: |
|
---|
Sets the internal value at the specified position (0-based).
Parameters: |
|
---|
Returns the internal values of this instance.
Returns: | the values as numpy array |
---|---|
Return type: | ndarray |
Returns the currently set weight.
Returns: | the weight |
---|---|
Return type: | float |
Bases: object
Iterator for rows in an Instances object.
Bases: object
Iterator for values in an Instance object.
Bases: weka.core.classes.JavaObject
Wrapper class for weka.core.Instances.
Adds the specified instance to the dataset.
Parameters: |
|
---|
Merges the two datasets (one-after-the-other). Throws an exception if the datasets aren’t compatible.
Parameters: |
|
---|---|
Returns: | the combined dataset |
Return type: | Instances |
Returns the specified attribute.
Parameters: | index (int) – the 0-based index of the attribute |
---|---|
Returns: | the attribute |
Return type: | Attribute |
Returns the specified attribute, None if not found.
Parameters: | name (str) – the name of the attribute |
---|---|
Returns: | the attribute or None |
Return type: | Attribute |
Returns the specified attribute statistics.
Parameters: | index (int) – the 0-based index of the attribute |
---|---|
Returns: | the attribute statistics |
Return type: | AttributeStats |
Returns an iterator over the attributes.
Returns the currently set class attribute.
Returns: | the class attribute |
---|---|
Return type: | Attribute |
Returns the currently set class index (0-based).
Returns: | the class index, -1 if not set |
---|---|
Return type: | int |
Sets the first attribute as class attribute (convenience method).
Sets the last attribute as class attribute (convenience method).
Compactifies the set of instances.
Creates a copy of the Instances. If either from_row or num_rows are None, then all of the data is being copied.
Parameters: |
|
---|---|
Returns: | the copy of the data |
Return type: | Instances |
Creates a new Instances.
Parameters: |
|
---|---|
Returns: | the dataset |
Return type: | Instances |
Removes either the specified Instance or all Instance objects.
Parameters: | index (int) – the 0-based index of the instance to remove |
---|
Deletes an attribute at the given position.
Parameters: | index (int) – the 0-based index of the attribute to remove |
---|
Deletes all attributes of the given type in the dataset.
Parameters: | typ (int) – the attribute type to remove, see weka.core.Attribute Javadoc |
---|
Deletes the first attribute.
Deletes the last attribute.
Deletes all rows that have a missing value at the specified attribute index.
Parameters: | index (int) – the attribute index to check for missing attributes |
---|
Compares this dataset against the given one in terms of attributes.
Parameters: | inst (Instances) – the dataset to compare against |
---|---|
Returns: | None if the same, otherwise an error message |
Return type: | str |
Returns the Instance object at the specified location.
Parameters: | index (int) – the 0-based index of the instance |
---|---|
Returns: | the instance |
Return type: | Instance |
Returns whether a class attribute is set (convenience method).
Returns: | whether a class attribute is currently set |
---|---|
Return type: | bool |
Inserts the attribute at the specified location.
Parameters: |
|
---|
Merges the two datasets (side-by-side).
Parameters: |
|
---|---|
Returns: | the combined dataset |
Return type: | Instances |
Unsets the class attribute (convenience method).
Returns the number of attributes.
Returns: | the number of attributes |
---|---|
Return type: | int |
Returns the number of instances.
Returns: | the number of instances |
---|---|
Return type: | int |
Randomizes the dataset using the random number generator.
Parameters: | random (Random) – the random number generator to use |
---|
Returns the name of the dataset.
Returns: | the name |
---|---|
Return type: | str |
Sets the Instance at the specified location in the dataset.
Parameters: |
|
---|---|
Returns: | the instance |
Return type: | Instance |
Sorts the dataset using the specified attribute index.
Parameters: | index (int) – the index of the attribute |
---|
Stratifies the data after randomization for nominal class attributes.
Parameters: | folds (int) – the number of folds to perform the stratification for |
---|
Generates a summary of the dataset.
Parameters: | inst (Instances) – the dataset |
---|---|
Returns: | the summary |
Return type: | str |
Uses the Instances as template to create an empty dataset.
Parameters: |
|
---|---|
Returns: | the empty dataset |
Return type: | Instances |
Generates a test fold for cross-validation.
Parameters: |
|
---|---|
Returns: | the training fold |
Return type: | Instances |
Generates a training fold for cross-validation.
Parameters: |
|
---|---|
Returns: | the training fold |
Return type: | Instances |
Generates a train/test split.
Parameters: |
|
---|---|
Returns: | the train/test splits |
Return type: | tuple |
Returns the internal values of this attribute from all the instance objects.
Returns: | the values as numpy array |
---|---|
Return type: | list |
Bases: weka.core.classes.JavaObject
Container for numeric attribute stats.
The number of values seen.
Returns: | The number of values seen |
---|---|
Return type: | float |
The maximum value seen, or Double.NaN if no values seen.
Returns: | The maximum value seen, or Double.NaN if no values seen |
---|---|
Return type: | float |
The mean of values at the last calculateDerived() call.
Returns: | The mean of values at the last calculateDerived() call |
---|---|
Return type: | float |
The minimum value seen, or Double.NaN if no values seen.
Returns: | The minimum value seen, or Double.NaN if no values seen |
---|---|
Return type: | float |
The std deviation of values at the last calculateDerived() call.
Returns: | The std deviation of values at the last calculateDerived() call |
---|---|
Return type: | float |
The sum of values seen.
Returns: | The sum of values seen |
---|---|
Return type: | float |
The sum of values squared seen.
Returns: | The sum of values squared seen |
---|---|
Return type: | float |
Allows the generation of an Instances object from a list of lists for X and a list for Y (optional). All data must be numerical. Attributes can be converted to nominal with the weka.filters.unsupervised.attribute.NumericToNominal filter.
Parameters: |
|
---|---|
Returns: | the generated dataset |
Return type: | Instances |
Allows the generation of an Instances object from a 2-dimensional matrix for X and a 1-dimensional matrix for Y (optional). All data must be numerical. Attributes can be converted to nominal with the weka.filters.unsupervised.attribute.NumericToNominal filter.
Parameters: |
|
---|---|
Returns: | the generated dataset |
Return type: | Instances |
Returns the value that represents missing values in Weka (NaN).
Returns: | missing value |
---|---|
Return type: | float |
Adds the bundled jars to the JVM’s classpath.
Adds the system’s classpath to the JVM’s classpath.
Adds the jars from all Weka packages to the JVM’s classpath.
Parameters: | alt_path (str) – an alternative weka home path |
---|
Initializes the javabridge connection (starts up the JVM).
Parameters: |
|
---|
Kills the JVM.
Bases: weka.core.classes.JavaObject
Wrapper for the weka.core.packageManagement.Dependency class.
Returns the source package.
Returns: | the package |
---|---|
Return type: | Package |
Returns the target package constraint.
Returns: | the package constraint |
---|---|
Return type: | PackageConstraint |
Bases: weka.core.classes.JavaObject
Wrapper for the weka.core.packageManagement.Package class.
Returns the dependencies of the package.
Returns: | the list of Dependency objects |
---|---|
Return type: | list of Dependency |
Installs the package.
Returns whether the package is installed.
Returns: | whether installed |
---|---|
Return type: | bool |
Returns the meta-data.
Returns: | the meta-data dictionary |
---|---|
Return type: | dict |
Returns the name of the package.
Returns: | the name |
---|---|
Return type: | str |
Returns the URL of the package.
Returns: | the url |
---|---|
Return type: | str |
Bases: weka.core.classes.JavaObject
Wrapper for the weka.core.packageManagement.PackageConstraint class.
Checks the constraints.
Parameters: |
|
---|
Returns the package.
Returns: | the package |
---|---|
Return type: | Package |
Sets the package.
Parameters: | pkge (Package) – the package |
---|
Returns a list of all packages.
Returns: | the list of packages |
---|---|
Return type: | list |
Returns a list of all packages that aren’t installed yet.
Returns: | the list of packages |
---|---|
Return type: | list |
Establishes the package cache if necessary.
The list of packages to install.
Parameters: |
|
---|---|
Returns: | whether successfully installed |
Return type: | bool |
Returns a list of the installed packages.
Returns: | the list of packages |
---|---|
Return type: | list |
Checks whether a package with the name is already installed.
Parameters: | name (str) – the name of the package |
---|---|
Returns: | whether the package is installed |
Return type: | bool |
Refreshes the cache.
Uninstalls a package.
Parameters: | name (str) – the name of the package |
---|---|
Returns: | whether successfully uninstalled |
Return type: | bool |
Creates a deep copy of the JavaObject (or derived class) or JB_Object.
Parameters: | obj (object) – the object to create a copy of |
---|---|
Returns: | the copy, None if failed to copy |
Return type: | object |
Reads the serialized object from disk. Caller must wrap object in appropriate Python wrapper class.
Parameters: | filename (str) – the file with the serialized object |
---|---|
Returns: | the JB_Object |
Return type: | JB_Object |
Reads the serialized objects from disk. Caller must wrap objects in appropriate Python wrapper classes.
Parameters: | filename (str) – the file with the serialized objects |
---|---|
Returns: | the list of JB_OBjects |
Return type: | list |
Serializes the object to disk. JavaObject instances get automatically unwrapped.
Parameters: |
|
---|
Serializes the list of objects to disk. JavaObject instances get automatically unwrapped.
Parameters: |
|
---|
Bases: weka.core.classes.OptionHandler
Wrapper class for stemmers.
Performs stemming on the string.
Parameters: | s (str) – the string to stem |
---|---|
Returns: | the stemmed string |
Return type: | str |
Bases: weka.core.classes.OptionHandler
Wrapper class for stopwords handlers.
Checks a string whether it is a stopword.
Parameters: | s (str) – the string to check |
---|---|
Returns: | True if a stopword |
Return type: | bool |
Bases: object
Iterator for string tokens.
Bases: weka.core.classes.OptionHandler
Wrapper class for tokenizers.
Tokenizes the string.
Parameters: | s (str) – the string to tokenize |
---|---|
Returns: | the iterator |
Return type: | TokenIterator |
Determines the version of Weka in use.
Returns: | the version |
---|---|
Return type: | str |