ThunderSVM
ThunderSVM: An Open-Source SVM Library on GPUs and CPUs
|
Dataset reader. More...
#include <dataset.h>
Classes | |
struct | node |
Public Types | |
typedef vector< vector< DataSet::node > > | node2d |
Public Member Functions | |
DataSet (const DataSet::node2d &instances, int n_features, const vector< float_type > &y) | |
void | load_from_file (string file_name) |
load dataset from file | |
void | load_from_python (float *y, char **x, int len) |
load dataset from python | |
void | group_classes (bool classification=true) |
group instances in same class | |
size_t | n_instances () const |
size_t | n_features () const |
size_t | n_classes () const |
const vector< int > & | count () const |
the number of instances for each class | |
const vector< int > & | start () const |
the start position of instances for each class | |
const vector< int > & | label () const |
mapping logical label (0,1,2,3,...) to real label (maybe 2,4,5,6,...) | |
const vector< float_type > & | y () const |
label for each instances, the instances are arranged as they are in file | |
const node2d & | instances () const |
const node2d | instances (int y_i) const |
instances of class \(y_i\) | |
const node2d | instances (int y_i, int y_j) const |
instances of class \(y_i\) and \(y_j\) | |
const vector< int > | original_index () const |
mapping instance index (after grouped) to the original index (in file) | |
const vector< int > | original_index (int y_i) const |
const vector< int > | original_index (int y_i, int y_j) const |
Dataset reader.
DataSet::DataSet | ( | const DataSet::node2d & | instances, |
int | n_features, | ||
const vector< float_type > & | y | ||
) |
construct a dataset using given instances
instances | given instances |
n_features | the number of features of given instances |
y | the label of each instances |