classification – Datasets for Supervised Classification Training

class pybrain.datasets.classification.ClassificationDataSet(inp, target=1, nb_classes=0, class_labels=None)

Bases: pybrain.datasets.supervised.SupervisedDataSet

Specialized data set for classification data. Classes are to be numbered from 0 to nb_classes-1.

__init__(inp, target=1, nb_classes=0, class_labels=None)

Initialize an empty dataset.

inp is used to specify the dimensionality of the input. While the number of targets is given by implicitly by the training samples, it can also be set explicity by nb_classes. To give the classes names, supply an iterable of strings as class_labels.

calculateStatistics()
Return a class histogram.
getClass(idx)
Return the label of given class.
splitByClass(cls_select)
Produce two new datasets, the first one comprising only the class selected (0..nClasses-1), the second one containing the remaining samples.
castToRegression(values)
Converts data set into a SupervisedDataSet for regression. Classes are used as indices into the value array given.
_convertToOneOfMany(bounds=(0, 1))

Converts the target classes to a 1-of-k representation, retaining the old targets as a field class.

To supply specific bounds, set the bounds parameter, which consists of target values for non-membership and membership.

_convertToClassNb()
The reverse of _convertToOneOfMany. Target field is overwritten.
class pybrain.datasets.classification.SequenceClassificationDataSet(inp, target, nb_classes=0, class_labels=None)

Bases: pybrain.datasets.sequential.SequentialDataSet, pybrain.datasets.classification.ClassificationDataSet

Defines a dataset for sequence classification. Each sample in the sequence still needs its own target value.

__init__(inp, target, nb_classes=0, class_labels=None)

Initialize an empty dataset.

inp is used to specify the dimensionality of the input. While the number of targets is given by implicitly by the training samples, it can also be set explicity by nb_classes. To give the classes names, supply an iterable of strings as class_labels.

Previous topic

optimization – Black-box Optimization Algorithms

Next topic

importance – Datasets for Weighted Supervised Training

This Page