Package PyML :: Package containers :: Module labels
[frames] | no frames]

Module labels

source code

Classes
  Labels
A class that holds the labels of a dataset.
Functions
 
mergeClasses(data, classList, newLabel=None)
Merge a list of classes into a new class.
source code
 
oneAgainstRest(data, classLabels, className=None)
creates a one-against-the-rest dataset/labels object
source code
 
randomLabels(Y)
shuffle the vector Y
source code
 
eliminateMultiLabeled(data) source code
 
eliminateSmallClasses(data, size)
returns a dataset that contains the classes of d that contain at least size patterns
source code
Function Details

mergeClasses(data, classList, newLabel=None)

source code 

Merge a list of classes into a new class.

  • data - a dataset container
  • classList - a list of classes to merge; can either provide the names of the classes or the index.
  • newLabel - the name of the new class (if not given then the label is formed by concatenating the names of the merged classes)

calls Labels.mergeClasses and returns the dataset with the modified labels

Parameters:  

oneAgainstRest(data, classLabels, className=None)

source code 

creates a one-against-the-rest dataset/labels object

Return value:

returns a dataset object where all class labels that are different
from the given class label/s are converted to a single class
Parameters:
  • data - a dataset
  • classLabels - a single class name, or a list of class names (string or a list of strings)
  • className - if given, the new name given to the class