class TrainingSet |
Class for reading and loading the training set from file
Attributes are loaded in the matrix data in numerical form.
![]() | TrainingSet (void) Dummy constructor |
![]() | TrainingSet ( unsigned num_attr, unsigned num_train, char separator = ', ') Constructor. |
![]() | TrainingSet ( unsigned num_attr, unsigned num_train, char* file, char separator = ', ', class_pos pos = last) Constructor. |
![]() | ~TrainingSet () Destructor |
![]() | normalize (void) It normalizes input data Input data are normalized in such a way that the mean value is zero and standard deviation sv is 1: normalized_x = (x - mean(x)) / sv. |
![]() | normalize_var (void) It normalizes input data Input data are normalized in such a way that the mean value is zero and the variance is 1. |
![]() | normalize (vect& m, vect& sv) It normalizes input data Input data are normalized in such a way that the mean value is zero and standard deviation sv is 1: normalized_x = (x - mean(x)) / sv. |
![]() | calc_mean_stdev (void) Computes mean and standard deviation of the data |
![]() | FoldRand (unsigned numfold, char* name) It subdivides a file for k-fold cross-validation |
![]() | Subsample_with_replacement (char* name, unsigned numsample, long initseed = 0) Subsampling with replacement of the data, saving results into a file It saves in the file name a subset of the data drawn with replacement according to a uniform probability distribution |
![]() | Subsample_with_replacement (unsigned numsample, long initseed = 0) Subsampling with replacement of the data It generates a subset of the data drawn with replacement according to a uniform probability distribution |
![]() | save (char* name) It stores the data set into a file |
![]() | save_light_format (char* name) It stores the data set into a file in SVM-light format All the classes with target <> 1 are relabeled with -1. |
![]() | set_thresholds (float low_thresh, float hi_tresh) Set a low threshold and a ceiling to the data |
![]() | Ntrain () const |
![]() | Nattr () const |
![]() | Nclass () const |
![]() | Read_target () |
![]() | Read_data () |
![]() | Set_data (matrix& m) |
![]() | Read_mean (void) |
![]() | Read_stdev (void) |
![]() | Is_normalized () const |
![]() | print_data () |
![]() | print_target () |
![]() | print_info () |
![]() | print_sep () |
![]() | read_sep () |
![]() | set_sep (char c) Set the data set separator character |
![]() | Transpose_data (void) Transpose the data matrix It swaps the rows and the columns of the data matrix. |
![]() | load_target (char* t) Load the file of the targets |
![]() | class_pos position order of the class in the rows of the data file |
![]() | n_train Training set cardinality |
![]() | n_attr Attributes cardinality |
![]() | n_class Cardinality of the classes |
![]() | sep character separator between attributes in the rows of the input data file |
![]() | target |
![]() | data Vettore numerico delle classi target |
![]() | mean Ncolonne = n_attr |
![]() | stdev valor medio degli input (dim: n_attr) |
![]() | is_normalized deviazione standard degli input (dim: n_attr) |
![]() | read (char* file, class_pos pos = last) Read a file containing the training set and load input data It loads input attributes data on matrix data and numerical target data identifying the classes in vector target. |
![]() | mean_calc (void) It computes then mean of the input pattern data |
![]() | stdev_calc (void) It computes then standard deviation of the input pattern data |
![]() | DoTestTrainFile (char* name, unsigned n, vector<unsigned>& v) It saves train and validation set (n-fold cross - validation) If v[i] = 1, data(i,:) and target t[i] are saved in the file namefntest, otherwise they are saved in the file namefntrain. |
![]() | save_pattern (ofstream& fdata, vect& patt, unsigned k) It saves a single pattern data and its class target k on a stream |
![]() | save_pattern_light_format (ofstream& fdata, vect& patt, int k) It saves a single pattern data and its class target k on a stream in SVM-light format |
![]() | save_subset (char* name, unsigned numsample, vect & subset) It saves a subset of data It saves numsample samples, using the indices in data and target stored in subset |
![]() | generate_subsample (unsigned numsample, vect & subset) It generates a subset of data It gebnerates numsample samples, using the indices in data and target stored in subset |
Class for reading and loading the training set from file
Attributes are loaded in the matrix data in numerical form. Classes are loaded in memory in numerical form in the vector target. Each line of the file to be read must be a sample, and each different attribute of the same sample must be separated by a separator or a sequence of blanks. The last field of the line is the class: attr1,attr2, ..., attrn_attr,target
Alphabetic index HTML hierarchy of classes or Java