Package classifiers :: Module data_splitter :: Class bluedata_groups
[frames] | no frames]

Class bluedata_groups

source code


Instance Methods
dictops.dict_of_lists
__init__(self, d, gr)
A 'grouper' function takes a DUID (a unique i.d.
source code
 
__len__(self) source code
tuple(list(datum_tr), list(datum_tr), list(str))
split(self, n, seed=0)
Take groups until you have accumulated approximately n data.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Class Variables
  HUGE = 1e+30
Properties

Inherited from object: __class__

Method Details

__init__(self, d, gr)
(Constructor)

source code 

A 'grouper' function takes a DUID (a unique i.d. string for a datum) and returns the name of the data group to which it belongs. This group name is used in constructing the training and test sets.

Parameters:
  • d (list(datum_c)) - a list of data
Returns: dictops.dict_of_lists
A dictionary full of lists; each list corresponds to one group.
Overrides: object.__init__

split(self, n, seed=0)

source code 

Take groups until you have accumulated approximately n data. The trick is to make all classifiers as identical as possible by getting the same balance of classes in the training set. We are willing to sacrifice some data to do that.

Parameters:
  • n (float or int) - how many data in the testing set
Returns: tuple(list(datum_tr), list(datum_tr), list(str))
(testing set, training set, names in training set)