Package PyML :: Package containers :: Module datafunc :: Class PySparseDataSet
[frames] | no frames]

Class PySparseDataSet

source code

??-82 --+
        |
       PySparseDataSet

A sparse dataset container
Instance Methods
 
__len__(self) source code
 
getNumFeatures(self) source code
 
setNumFeatures(self, value) source code
 
copy(self, other, patternsToCopy, deepcopy)
copy the X variable of a sparse dataset INPUT: other - the other dataset patternsToCopy - a list of patterns to copy deepcopy - a 0/1 flag telling whether to do deepcopy or not
source code
 
initializeDataMatrix(self, numPatterns, numFeatures) source code
 
addPattern(self, x, i) source code
 
addFeature(self, id, values) source code
 
getPattern(self, i) source code
 
featureIDcompute(self) source code
 
extendX(self, other, patterns) source code
 
eliminateFeatures(self, featureList)
eliminate a list of features from a dataset INPUT: featureList - a list of features to eliminate; these are numbers between 0 and numFeatures-1 (indices of features, not their IDs)
source code
 
featureView(self)
F is a list where F[i] is a dictionary whose entries are the non zero entries of feature number i: F[self.featureKeyDict[f]][i] = X[i][f]
source code
 
getFeature(self, feature, patterns=None) source code
 
dotProduct(self, x, y, other=None) source code
 
norm(self, pattern, p=1) source code
 
normalize(self, p=1)
normalize dataset according to the p-norm, p=1,2
source code
 
scale(self, w)
rescale the columns of the data matrix by a weight vector w: set X[i][j] = X[i][j] * w[j] w is either a dictionary or an array
source code
 
mean(self, patterns=None) source code
 
translate(self, translation)
subtract the input array from the data.
source code
 
std(self, patterns=None) source code
 
featureCount(self, feature, patterns=None) source code
 
featureCounts(self, patterns=None) source code
Class Variables
  numFeatures = property(getNumFeatures, setNumFeatures, None, '...
Method Details

translate(self, translation)

source code 
subtract the input array from the data. the sparsity of the data is not altered, ie, zero entries are not made nonzero by the translation

Class Variable Details

numFeatures

Value:
property(getNumFeatures, setNumFeatures, None, 'The number of features\
 in a dataset')