Main Page | Class List | File List | Class Members

InstanceSet Class Reference

InstanceSet class. Interface for loading training/testing data.

#include <instance_set.h>

List of all members.

Public Member Functions

 InstanceSet ()
 Empty constructor.

void save_var (int var, vector< float > *target)
 copy a variable array out

void load_var (int var, const vector< float > &)
 load a variable array in

void permute (int var, unsigned int *seed)
 permute a variable's instances (shuffle)

void create_sorted_indices ()
 sort the variables

const vector< int > & get_sorted_indices (int attribute) const
 Sorted indices (available after create_sorted_indices).

int mode_label () const
 Most common label.

unsigned char label (int i) const
 Get a particular instance's label.

unsigned int size () const
 Number of instances.

unsigned int num_attributes () const
 Number of attributes.

float get_attribute (int i, int attr) const
 Get a particular instance's attribute.

string get_varname (int i) const
 Get a variable name (useful if there is a header with var.


Static Public Member Functions

InstanceSetcreate_subset (const InstanceSet &, const weight_list &)
 Named constructor - create a subset from an existing instanceset.

InstanceSetload_csv_and_labels (const string &data, const string &labels, bool header=false, const string &delim=",")
 Named constructor - load from csv file and a label file.

InstanceSetload_libsvm (const string &data, int num_features)
 Load from a libsvm formatted file.


Member Function Documentation

InstanceSet * create_subset const InstanceSet set,
const weight_list &  wl
[static]
 

Named constructor for creating a subset from an existing set

Parameters:
set existing set
wl non-zeroes weights

InstanceSet * load_libsvm const string &  data,
int  nf
[static]
 

Named constructor for loading from a .libsvm format

Parameters:
data filename
nf number of features (makes life easier to specify this)

void permute int  var,
unsigned int *  seed
 

Permute method Used for variable importance


The documentation for this class was generated from the following files:
Generated on Mon Jan 8 23:19:06 2007 for librf by doxygen 1.3.7