Home | Trees | Indices | Help |
|
---|
|
object --+ | FeatureMatrix
FeatureMatrix
Feature matrix to be used for training or prediction.
Instance Methods | |||
iterable |
|
||
FeatureMatrix |
|
||
iterable |
|
||
FeatureMatrix |
|
||
|
|||
Inherited from |
Static Methods | |||
FeatureMatrix |
|
Properties | |
int |
height The matrix height (number of labels and vectors). |
int |
width The matrix width (number of features). |
Inherited from |
Method Details |
assign_labels
is omitted or None, the iterable is expected to provide 2-tuples,
containing the label and the accompanying feature vector. If
assign_labels is passed and not None, the iterable should only
provide the feature vectors. All labels are then assigned to the value of
assign_labels .
|
|
|
|
Create FeatureMatrix instance from a file. Each line of the file contains the label and the accompanying sparse feature vector, separated by a space/tab sequence. The feature vector consists of index/value pairs. The index and the value are separated by a colon (:). The pairs are separated by space/tab sequences. Accepted line endings are \r, \n and \r\n. All numbers are represented as strings parsable either as ints (for indexes) or doubles (for values and labels). Note that the exact I/O exceptions depend on the stream passed in.
|
Save FeatureMatrix instance to a file. Each line of the line of the file contains the label and the accompanying sparse feature vector, separated by a space. The feature vector consists of index/value pairs. The index and the value are separated by a colon (:). The pairs are separated by a space again. The line ending is \n. All numbers are represented as strings parsable either as ints (for indexes) or doubles (for values and labels). Note that the exact I/O exceptions depend on the stream passed in.
|
Property Details |
heightThe matrix height (number of labels and vectors).
|
widthThe matrix width (number of features).
|
Home | Trees | Indices | Help |
|
---|