Xmipp  v3.23.11-Nereus
Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Friends | List of all members
ClassificationTrainingSet< Item, Target > Class Template Reference

#include <training_set.h>

Public Types

enum  splitMode { CROSSVAL, SPLITSAMPLE, JACKKNIFE, BOOTSTRAP }
 Ways the training set can be used. More...
 
enum  useMode { TRAIN = 0, VALIDATION = 1, TEST = 2 }
 use of samples More...
 
typedef std::multimap< unsigned, unsigned, std::less< unsigned > > splitTS
 Training sets mode. More...
 
typedef splitTS::iterator splitIt
 iterator More...
 

Public Member Functions

 ClassificationTrainingSet (const bool &_calib=true, unsigned _n=0)
 
 ClassificationTrainingSet (std::istream &_is)
 
virtual ~ClassificationTrainingSet ()
 
void setSplit (float _tp, float _vp)
 
splitIt beginSubset (unsigned _um)
 
splitIt endSubset (unsigned _um)
 Returns an iterator to the end of the subset. More...
 
virtual void add (const Item &_i, const Target &_tg)
 
virtual void add (const Item &_i)
 
virtual bool remove (unsigned int _idx)
 
size_t size () const
 
const Target & targetAt (unsigned _i) const
 
Target & targetAt (unsigned _i)
 
const Item & itemAt (unsigned _i) const
 
Item & itemAt (unsigned _i)
 
bool calibrated () const
 
void calibrated (const bool &_calib)
 
void clear ()
 
virtual void printSelf (std::ostream &_os) const
 
virtual void readSelf (std::istream &_is)
 
virtual void saveObject (std::ostream &_os) const
 
virtual void loadObject (std::istream &_is)
 
unsigned numTargets () const
 
virtual bool swapItems (unsigned _i, unsigned _j)
 

Public Attributes

std::vector< Item > theItems
 
std::vector< Target > theTargets
 

Protected Member Functions

void computeNumTargets ()
 
void checkCalibrated (std::istream &_is)
 
void readItems (std::istream &_is)
 
void writeCalibrated (std::ostream &_os) const
 
void writeItems (std::ostream &_os, bool _delim=false) const
 
void skipComments (std::istream &_is) const
 
std::vector< Item >::const_iterator itemsBegin () const
 
std::vector< Item >::const_iterator itemsEnd () const
 
std::vector< Target >::const_iterator targetsBegin () const
 
std::vector< Target >::const_iterator targetsEnd () const
 

Protected Attributes

bool isCalibrated
 
splitTS splitTrainingSet
 
unsigned nTargets
 

Friends

std::ostream & operator<< (std::ostream &_os, const ClassificationTrainingSet &_ts)
 
std::istream & operator>> (std::istream &_is, ClassificationTrainingSet &_ts)
 

Detailed Description

template<class Item, class Target>
class ClassificationTrainingSet< Item, Target >

Generic training sets. This is the parent class for all possible training sets that can be used by the classification algorithms. It provides the library with the basic functionality of training vectors. This a template class that takes as input the type of the training vectors and the type of the target variable (for supervised analysis) \The following example shows the declaration of a training set formed by a vector of doubles and a target variable of type string. \ \ClassificationTrainingSet<double, string> myTS;

Definition at line 61 of file training_set.h.

Member Typedef Documentation

◆ splitIt

template<class Item, class Target>
typedef splitTS::iterator ClassificationTrainingSet< Item, Target >::splitIt

iterator

Definition at line 69 of file training_set.h.

◆ splitTS

template<class Item, class Target>
typedef std::multimap<unsigned, unsigned, std::less<unsigned> > ClassificationTrainingSet< Item, Target >::splitTS

Training sets mode.

Definition at line 66 of file training_set.h.

Member Enumeration Documentation

◆ splitMode

template<class Item, class Target>
enum ClassificationTrainingSet::splitMode

Ways the training set can be used.

Enumerator
CROSSVAL 
SPLITSAMPLE 
JACKKNIFE 
BOOTSTRAP 

Definition at line 72 of file training_set.h.

◆ useMode

template<class Item, class Target>
enum ClassificationTrainingSet::useMode

use of samples

Enumerator
TRAIN 
VALIDATION 
TEST 

Definition at line 75 of file training_set.h.

Constructor & Destructor Documentation

◆ ClassificationTrainingSet() [1/2]

template<class Item, class Target>
ClassificationTrainingSet< Item, Target >::ClassificationTrainingSet ( const bool &  _calib = true,
unsigned  _n = 0 
)
inline

Default constructor Parameter: _calib: True if the trainign set is calibrated (labeled) Parameter: _n: Number of items that the trained set should contain

Definition at line 92 of file training_set.h.

93  :isCalibrated(_calib), /* splitTrainingSet(), */nTargets(0), theItems(_n) /*theTargets(_n), */
94  {};
std::vector< Item > theItems
Definition: training_set.h:84

◆ ClassificationTrainingSet() [2/2]

template<class Item, class Target>
ClassificationTrainingSet< Item, Target >::ClassificationTrainingSet ( std::istream &  _is)
inline

Constructs a training set given a stream Parameter: _is The input stream

Definition at line 101 of file training_set.h.

102  {
103  loadObject(_is);
105  };
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85
virtual void loadObject(std::istream &_is)
Definition: training_set.h:360

◆ ~ClassificationTrainingSet()

template<class Item, class Target>
virtual ClassificationTrainingSet< Item, Target >::~ClassificationTrainingSet ( )
inlinevirtual

Virtual destructor

Definition at line 110 of file training_set.h.

111  {};

Member Function Documentation

◆ add() [1/2]

template<class Item, class Target>
virtual void ClassificationTrainingSet< Item, Target >::add ( const Item &  _i,
const Target &  _tg 
)
inlinevirtual

Adds an item to the training set Parameter: _i The item Parameter: _tg The target (Used only if the TS is calibrated).

Reimplemented in FuzzyMap, and ClassificationMap.

Definition at line 171 of file training_set.h.

172  {
173  theItems.push_back(_i);
174  theTargets.push_back(_tg);
175  };
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85

◆ add() [2/2]

template<class Item, class Target>
virtual void ClassificationTrainingSet< Item, Target >::add ( const Item &  _i)
inlinevirtual

Adds an item to a non calibrated training set Parameter: _i The item

Definition at line 183 of file training_set.h.

184  {
185  theItems.push_back(_i);
186  };
std::vector< Item > theItems
Definition: training_set.h:84

◆ beginSubset()

template<class Item, class Target>
splitIt ClassificationTrainingSet< Item, Target >::beginSubset ( unsigned  _um)
inline

Returns an iterator to the beginning of the subset Parameter: _um is the mode: training, testing or validation

Returns
an iterator to the beginning of the subset;

Definition at line 154 of file training_set.h.

155  {
156  return splitTrainingSet.lower_bound(_um);
157  }

◆ calibrated() [1/2]

template<class Item, class Target>
bool ClassificationTrainingSet< Item, Target >::calibrated ( ) const
inline

Returns true if the training set is calibreted or not

Definition at line 301 of file training_set.h.

302  {
303  return isCalibrated;
304  }

◆ calibrated() [2/2]

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::calibrated ( const bool &  _calib)
inline

Sets the calibrated flag.

Definition at line 310 of file training_set.h.

311  {
312  isCalibrated = _calib;
313  };

◆ checkCalibrated()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::checkCalibrated ( std::istream &  _is)
inlineprotected

Checks if the training set is calibrated or not Parameter: _is The input stream

Exceptions
runtime_errorIf there are problems with the stream

Definition at line 442 of file training_set.h.

443  {
444  skipComments(_is);
445 
446  if (_is)
447  {
448  std::string s;
449  _is >> s;
450 
451  // Comments skipped, read calibrated
452  if (_is)
453  {
454  std::string s2 = "";
455 
456  // uppercase s
457  for (std::string::iterator i = s.begin() ; i != s.end() ; i++)
458  s2 += toupper(*i);
459 
460  if (s2 == "CALIBRATED")
461  isCalibrated = true;
462  else
463  for (std::string::iterator i = s.end() ; i > s.begin() ; _is.putback(*(--i)));
464  }
465  }
466 
467  if (!_is)
468  {
469  std::string msg;
470  msg = "Error reading the file";
471  throw std::runtime_error(msg);
472  }
473  };
#define i
void skipComments(std::istream &_is) const
Definition: training_set.h:598

◆ clear()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::clear ( )
inline

Clears the training set: all items and targets are suppresed; all other variables remain the same

Definition at line 318 of file training_set.h.

319  {
320  theItems.clear();
321  theTargets.clear();
322  nTargets = 0;
323  };
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85

◆ computeNumTargets()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::computeNumTargets ( )
inlineprotected

Compute the number of different targets in the training set

Definition at line 420 of file training_set.h.

421  {
422  if (calibrated())
423  {
424  typedef std::set< Target, std::less<Target> > STB;
425  STB targetSet;
426  for (unsigned i = 0; i < size(); i ++)
427  {
428  targetSet.insert(targetAt(i));
429  }
430  // Assign the number of targets
431  nTargets = targetSet.size();
432  }
433  else
434  nTargets = 0;
435  }
const Target & targetAt(unsigned _i) const
Definition: training_set.h:221
#define i

◆ endSubset()

template<class Item, class Target>
splitIt ClassificationTrainingSet< Item, Target >::endSubset ( unsigned  _um)
inline

Returns an iterator to the end of the subset.

Definition at line 160 of file training_set.h.

161  {
162  return splitTrainingSet.upper_bound(_um);
163  }

◆ itemAt() [1/2]

template<class Item, class Target>
const Item& ClassificationTrainingSet< Item, Target >::itemAt ( unsigned  _i) const
inline

Returns a const reference to the specified item Parameter: _i The index

Exceptions
out_of_rangeIf _i is out of range

Definition at line 264 of file training_set.h.

265  {
266  if (_i >= size())
267  {
268  std::string msg;
269  msg = "Out of range. No item at position " + integerToString(_i);
270  throw std::out_of_range(msg);
271  }
272 
273  return theItems[_i];
274  };
String integerToString(int I, int _width, char fill_with)
std::vector< Item > theItems
Definition: training_set.h:84

◆ itemAt() [2/2]

template<class Item, class Target>
Item& ClassificationTrainingSet< Item, Target >::itemAt ( unsigned  _i)
inline

Returns a recerence to an item. Parameter: _i The index Parameter: _item The item

Exceptions
out_of_rangeIf _i is out of range

Definition at line 284 of file training_set.h.

285  {
286  if (_i >= size())
287  {
288  std::string msg;
289  msg = "Out of range. No item at position " + integerToString(_i);
290  throw std::out_of_range(msg);
291  }
292 
293  return theItems[_i];
294  };
String integerToString(int I, int _width, char fill_with)
std::vector< Item > theItems
Definition: training_set.h:84

◆ itemsBegin()

template<class Item, class Target>
std::vector<Item>::const_iterator ClassificationTrainingSet< Item, Target >::itemsBegin ( ) const
inlineprotected

Protected interface to the items

Returns
a const_iterator that points to the first Item in the set

Definition at line 624 of file training_set.h.

625  {
626  return theItems.begin();
627  }
std::vector< Item > theItems
Definition: training_set.h:84

◆ itemsEnd()

template<class Item, class Target>
std::vector<Item>::const_iterator ClassificationTrainingSet< Item, Target >::itemsEnd ( ) const
inlineprotected

Protected interface to the items

Returns
a const_iterator that points to the last Item in the set

Definition at line 633 of file training_set.h.

634  {
635  return theItems.end();
636  }
std::vector< Item > theItems
Definition: training_set.h:84

◆ loadObject()

template<class Item, class Target>
virtual void ClassificationTrainingSet< Item, Target >::loadObject ( std::istream &  _is)
inlinevirtual

Loads the class from a stream. this method can be used to load the status of the class. Parameter: _is The output stream

Reimplemented in FuzzyMap, ClassificationMap, FuzzyCodeBook, CodeBook, and ClassicTrainingVectors.

Definition at line 360 of file training_set.h.

361  {
362  clear();
363  // first of all, check if the training set is calibrated or not
364  checkCalibrated(_is);
365  //afterwards, we have to read the item
366  readItems(_is);
367  }
void checkCalibrated(std::istream &_is)
Definition: training_set.h:442
void readItems(std::istream &_is)
Definition: training_set.h:481

◆ numTargets()

template<class Item, class Target>
unsigned ClassificationTrainingSet< Item, Target >::numTargets ( ) const
inline

Returns the number of different classes in the (calibrated) training set

Exceptions
runtime_errorIf the training set is not calibrated

Definition at line 373 of file training_set.h.

374  {
375  if (!calibrated())
376  throw std::runtime_error("TS not calibrated");
377  return nTargets;
378  }

◆ printSelf()

template<class Item, class Target>
virtual void ClassificationTrainingSet< Item, Target >::printSelf ( std::ostream &  _os) const
inlinevirtual

Standard output for a training set Parameter: _os The output stream

Reimplemented in FuzzyMap, ClassificationMap, CodeBook, and ClassicTrainingVectors.

Definition at line 330 of file training_set.h.

331  {
332  writeItems(_os);
333  }
void writeItems(std::ostream &_os, bool _delim=false) const
Definition: training_set.h:561

◆ readItems()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::readItems ( std::istream &  _is)
inlineprotected

Read the items Parameter: _is The input stream

Exceptions
runtime_errorIf there are problems with the stream

Definition at line 481 of file training_set.h.

482  {
483  while (_is)
484  {
485  skipComments(_is);
486  if (_is)
487  {
488  Item item;
489  try
490  {
491  _is >> item;
492  }
493  catch (std::exception&)
494  {
495  std::string msg;
496  msg = "Error reading the item";
497  throw std::runtime_error(msg);
498  }
499 
500  if (_is)
501  {
502  theItems.push_back(item);
503  if (isCalibrated)
504  {
505  Target target;
506  try
507  {
508  char c;
509  if (_is) _is >> c;
510  // go back to the beginning of the line
511  if (_is) _is.putback(c);
512  // check for next line "<"
513  if (c == '<')
514  target = Target();
515  else
516  if (_is)
517  _is >> target;
518  else
519  target = Target();
520  }
521  catch (std::exception&)
522  {
523  std::string msg;
524  msg = "Error reading the item";
525  throw std::runtime_error(msg);
526  }
527 
528  theTargets.push_back(target);
529  }
530  else
531  theTargets.push_back(Target());
532  }
533  else
534  {
535  std::string msg;
536  msg = "Error reading the item";
537  throw std::runtime_error(msg);
538  }
539  }
540  }
541  };
doublereal * c
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85
void skipComments(std::istream &_is) const
Definition: training_set.h:598

◆ readSelf()

template<class Item, class Target>
virtual void ClassificationTrainingSet< Item, Target >::readSelf ( std::istream &  _is)
inlinevirtual

Standard input for a training set Parameter: _is The input stream

Exceptions
runtime_errorIf there are problems with the stream NOTE: This method is empty, it should be defined.

Reimplemented in ClassificationMap, and ClassicTrainingVectors.

Definition at line 341 of file training_set.h.

342  {}

◆ remove()

template<class Item, class Target>
virtual bool ClassificationTrainingSet< Item, Target >::remove ( unsigned int  _idx)
inlinevirtual

Deletes an item from the training set Parameter: _idx The index

Definition at line 193 of file training_set.h.

194  {
195 
196  if (_idx > theItems.size())
197  return false;
198 
199  theItems.erase(theItems.begin() + _idx);
200  if (isCalibrated)
201  theTargets.erase(theTargets.begin() + _idx);
202 
203  return true;
204  };
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85

◆ saveObject()

template<class Item, class Target>
virtual void ClassificationTrainingSet< Item, Target >::saveObject ( std::ostream &  _os) const
inlinevirtual

Saves the class into a stream. this method can be used to save the status of the class. Parameter: _os The output stream

Reimplemented in FuzzyMap, ClassificationMap, FuzzyCodeBook, CodeBook, and ClassicTrainingVectors.

Definition at line 349 of file training_set.h.

350  {
351  writeCalibrated(_os);
352  writeItems(_os, true);
353  }
void writeItems(std::ostream &_os, bool _delim=false) const
Definition: training_set.h:561
void writeCalibrated(std::ostream &_os) const
Definition: training_set.h:549

◆ setSplit()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::setSplit ( float  _tp,
float  _vp 
)
inline

Sets the proportion of training, validation and testing and creates the map. Used for split-sample training and validation. Parameters must be between 0 and 1 and must add to less than 1; the rest will be used for testing Parameter: _tp proportion over 1 of samples devoted to training Parameter: _vp proportion over 1 of samples devoted to validation

Definition at line 120 of file training_set.h.

121  {
122  if ((_tp > 1) || (_tp <= 0) || (_vp > 1) || (_vp <= 0) || (_tp + _vp > 1))
123  {
124  throw std::invalid_argument("Split mode proportions must be < 1");
125  }
126  std::vector<float> acc(2); // 3 modes
127  acc[TRAIN] = _tp;
128  acc[VALIDATION] = _tp + _vp;
129  std::random_device rd; //Will be used to obtain a seed for the random number engine
130  std::mt19937 gen(rd()); //Standard mersenne_twister_engine seeded with rd()
131  std::uniform_real_distribution<> dist(0.f, 1.f);
132  for (unsigned i = 0; i < size(); i ++)
133  {
134  float aRnd = dist(gen);
135  unsigned rw = TEST;
136  for (unsigned j = TRAIN; j < TEST; j ++)
137  {
138  if (aRnd < acc[j])
139  {
140  rw = j;
141  break;
142  }
143  }
144  splitTrainingSet.insert(std::pair<unsigned, unsigned>(rw, i));
145  }
146  }
#define i
double * f
#define j

◆ size()

template<class Item, class Target>
size_t ClassificationTrainingSet< Item, Target >::size ( ) const
inline

Returns the number of items in the training set

Definition at line 210 of file training_set.h.

211  {
212  return theItems.size();
213  };
std::vector< Item > theItems
Definition: training_set.h:84

◆ skipComments()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::skipComments ( std::istream &  _is) const
inlineprotected

Skip the comments if the stream Parameter: _is The input stream

Definition at line 598 of file training_set.h.

599  {
600  char c;
601  if (_is)
602  _is >> c;
603 
604  // check for comments
605  while (_is && c == '#')
606  {
607  // skip the comment
608  while (_is && _is.get() != '\n');
609 
610  // read beginning of next line
611  if (_is)
612  _is >> c;
613  }
614 
615  // go back to the beginning of the line
616  if (_is)
617  _is.putback(c);
618  };
doublereal * c

◆ swapItems()

template<class Item, class Target>
virtual bool ClassificationTrainingSet< Item, Target >::swapItems ( unsigned  _i,
unsigned  _j 
)
inlinevirtual

Swaps two items in the vector

Definition at line 383 of file training_set.h.

384  {
385  if (_i > size() || _j > size() || _i == _j)
386  return false;
387  swap(theItems[_i], theItems[_j]);
388  if (isCalibrated)
389  swap(theTargets[_i], theTargets[_j]);
390  return true;
391  }
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85

◆ targetAt() [1/2]

template<class Item, class Target>
const Target& ClassificationTrainingSet< Item, Target >::targetAt ( unsigned  _i) const
inline

Returns a const reference to the specified target Parameter: _i The index

Exceptions
out_of_rangeIf _i is out of range

Definition at line 221 of file training_set.h.

222  {
223  if (!isCalibrated)
224  {
225  std::string msg;
226  msg = "The training set is not calibrated.";
227  throw std::out_of_range(msg);
228  }
229  if (_i >= size())
230  {
231  std::string msg;
232  msg = "Out of range. No target at position " + integerToString(_i);
233  throw std::out_of_range(msg);
234  }
235 
236  return theTargets[_i];
237  };
String integerToString(int I, int _width, char fill_with)
std::vector< Target > theTargets
Definition: training_set.h:85

◆ targetAt() [2/2]

template<class Item, class Target>
Target& ClassificationTrainingSet< Item, Target >::targetAt ( unsigned  _i)
inline

Returns a reference to a target. Parameter: _i The index

Exceptions
out_of_rangeIf _i is out of range

Definition at line 245 of file training_set.h.

246  {
247  if (_i >= size())
248  {
249  std::string msg;
250  msg = "Out of range. No target at position " + integerToString(_i);
251  throw std::out_of_range(msg);
252  }
253 
254  return theTargets[_i];
255  };
String integerToString(int I, int _width, char fill_with)
std::vector< Target > theTargets
Definition: training_set.h:85

◆ targetsBegin()

template<class Item, class Target>
std::vector<Target>::const_iterator ClassificationTrainingSet< Item, Target >::targetsBegin ( ) const
inlineprotected

Protected interface to the targets

Returns
a const_iterator that points to the first Target in the set

Definition at line 643 of file training_set.h.

644  {
645  return theTargets.begin();
646  }
std::vector< Target > theTargets
Definition: training_set.h:85

◆ targetsEnd()

template<class Item, class Target>
std::vector<Target>::const_iterator ClassificationTrainingSet< Item, Target >::targetsEnd ( ) const
inlineprotected

Protected interface to the targets

Returns
a const_iterator that points to the last Target in the set

Definition at line 651 of file training_set.h.

652  {
653  return theTargets.end();
654  }
std::vector< Target > theTargets
Definition: training_set.h:85

◆ writeCalibrated()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::writeCalibrated ( std::ostream &  _os) const
inlineprotected

Writes if the training set is calibrated or not Parameter: _os The output stream

Definition at line 549 of file training_set.h.

550  {
551  if (isCalibrated)
552  _os << "calibrated" << std::endl;
553  };

◆ writeItems()

template<class Item, class Target>
void ClassificationTrainingSet< Item, Target >::writeItems ( std::ostream &  _os,
bool  _delim = false 
) const
inlineprotected

Writes the items Parameter: _os The output stream Parameter: _delim Flag to use "<" delimiters (false by default)

Definition at line 561 of file training_set.h.

562  {
563  typename std::vector<Item>::const_iterator i;
564  typename std::vector<Target>::const_iterator j;
565  for (i = theItems.begin(), j = theTargets.begin() ; i < theItems.end() ;
566  i++, j++)
567  {
568 
569  if (_delim)
570  _os << *i;
571  else
572  {
573  for (size_t d = 0; d < (*i).size(); d++)
574  {
575  _os << (*i)[d];
576  if (d != (*i).size() - 1) _os << " ";
577  }
578  }
579 
580  /* if (isCalibrated) {
581  if ((*j == " " || *j == "") && _delim)
582  _os << "|";
583  else
584  _os << " " << *j;
585  }*/
586  if (isCalibrated)
587  _os << " " << *j;
588 
589  _os << std::endl;
590  }
591  };
#define i
doublereal * d
std::vector< Item > theItems
Definition: training_set.h:84
std::vector< Target > theTargets
Definition: training_set.h:85
#define j

Friends And Related Function Documentation

◆ operator<<

template<class Item, class Target>
std::ostream& operator<< ( std::ostream &  _os,
const ClassificationTrainingSet< Item, Target > &  _ts 
)
friend

Standard output for a training set Parameter: _os The output stream Parameter: _ts The training set to be printed

Definition at line 397 of file training_set.h.

398  {
399  _ts.printSelf(_os);
400  return _os;
401  }
virtual void printSelf(std::ostream &_os) const
Definition: training_set.h:330

◆ operator>>

template<class Item, class Target>
std::istream& operator>> ( std::istream &  _is,
ClassificationTrainingSet< Item, Target > &  _ts 
)
friend

Standard input for a training set Parameter: _is The input stream Parameter: _ts The training set to be read

Exceptions
runtime_errorIf there are problems with the stream

Definition at line 409 of file training_set.h.

410  {
411  _ts.readSelf(_is);
412  return _is;
413  }
virtual void readSelf(std::istream &_is)
Definition: training_set.h:341

Member Data Documentation

◆ isCalibrated

template<class Item, class Target>
bool ClassificationTrainingSet< Item, Target >::isCalibrated
protected

Definition at line 78 of file training_set.h.

◆ nTargets

template<class Item, class Target>
unsigned ClassificationTrainingSet< Item, Target >::nTargets
protected

Definition at line 82 of file training_set.h.

◆ splitTrainingSet

template<class Item, class Target>
splitTS ClassificationTrainingSet< Item, Target >::splitTrainingSet
protected

Definition at line 79 of file training_set.h.

◆ theItems

template<class Item, class Target>
std::vector<Item> ClassificationTrainingSet< Item, Target >::theItems

Definition at line 84 of file training_set.h.

◆ theTargets

template<class Item, class Target>
std::vector<Target> ClassificationTrainingSet< Item, Target >::theTargets

Definition at line 85 of file training_set.h.


The documentation for this class was generated from the following file: