iRoCS Toolbox  1.1.0
Public Types | Public Member Functions | Static Public Member Functions
svt::LoadSaveASCII Class Reference

#include <LoadSaveASCII.hh>

Collaboration diagram for svt::LoadSaveASCII:

Public Types

typedef StDataASCIIFile STDATA
 

Public Member Functions

 ~LoadSaveASCII ()
 
void checkParamsForLoadFeatureVectors (StDataCmdLine &cmdline) const
 Just accesses all parameters, that are used in loadFeatureVectors() so that they are no longer unknwon to StDataASCIIFile. More...
 
bool checkParamsForLoadSubsetLabels (StDataCmdLine &cmdline) const
 checks wether the "--subset_att" parameter was given. More...
 
bool checkParamsForSaveClassificationResults (StDataCmdLine &cmdline) const
 Just accesses all parameters, that are used in saveClassificationResults() so that they are no longer unknwon to StDataASCIIFile. More...
 
void checkParamsForSaveModel (StDataCmdLine &cmdline) const
 Just accesses all parameters, that are used in saveModel() so that they are no longer unknwon to StDataASCIIFile. More...
 
template<typename FV , typename ALGORITHMS >
BasicSVMAdapter< FV, STDATA > * createSVMAndLoadModel (StDataCmdLine &cmdline)
 create SVM from file and load Model data More...
 
template<typename FV >
void loadFeatureVectors (StDataCmdLine &cmdline, std::vector< FV > &featureVectors)
 load feature vectors More...
 
void loadSubsetLabels (StDataCmdLine &cmdline, std::vector< int > &subsetIndexByUID)
 load feature vectors More...
 
void saveClassificationResults (StDataCmdLine &cmdline, const std::vector< double > &results, const std::vector< StDataASCII > &details, bool saveDetails, std::ostream &os)
 save classification results. More...
 
template<typename FV >
void saveModel (StDataCmdLine &cmdline, BasicSVMAdapter< FV, STDATA > *svm, int detailLevel, std::ostream &os)
 save Model. More...
 

Static Public Member Functions

static void getParamInfosForCreateSVMAndLoadModel (std::vector< ParamInfo > &p)
 get information about the parameters, that are used in createSVMAndLoadModel(). More...
 
static void getParamInfosForLoadFeatureVectors (std::vector< ParamInfo > &p)
 get information about the parameters, that are used in loadFeatureVectors(). More...
 
static void getParamInfosForLoadSubsetLabels (std::vector< ParamInfo > &p)
 get information about the parameters, that are used in loadSubsetLabels(). More...
 
static void getParamInfosForSaveClassificationResults (std::vector< ParamInfo > &p)
 get information about the parameters, that are used in createSVMAndLoadModel(). More...
 
static void getParamInfosForSaveModel (std::vector< ParamInfo > &p)
 get information about the parameters, that are used in saveModel(). More...
 

Detailed Description

Definition at line 84 of file LoadSaveASCII.hh.

Member Typedef Documentation

◆ STDATA

Definition at line 88 of file LoadSaveASCII.hh.

Constructor & Destructor Documentation

◆ ~LoadSaveASCII()

svt::LoadSaveASCII::~LoadSaveASCII ( )
inline

Definition at line 90 of file LoadSaveASCII.hh.

Member Function Documentation

◆ getParamInfosForLoadFeatureVectors()

static void svt::LoadSaveASCII::getParamInfosForLoadFeatureVectors ( std::vector< ParamInfo > &  p)
static

get information about the parameters, that are used in loadFeatureVectors().

The Infos are appended to the passed array

Parameters
parray of ParamInfos. The Infos will be appended to this array

Referenced by ~LoadSaveASCII().

◆ checkParamsForLoadFeatureVectors()

void svt::LoadSaveASCII::checkParamsForLoadFeatureVectors ( StDataCmdLine cmdline) const

Just accesses all parameters, that are used in loadFeatureVectors() so that they are no longer unknwon to StDataASCIIFile.

Parameters
cmdlinecommand line

Referenced by ~LoadSaveASCII().

◆ loadFeatureVectors()

template<typename FV >
void svt::LoadSaveASCII::loadFeatureVectors ( StDataCmdLine cmdline,
std::vector< FV > &  featureVectors 
)

load feature vectors

Parameters
cmdlinecommand line parameters
featureVectorsthe loaded feature vectors
Exceptions
svt::LoadErrorfile could not be opened

Referenced by ~LoadSaveASCII().

◆ getParamInfosForLoadSubsetLabels()

static void svt::LoadSaveASCII::getParamInfosForLoadSubsetLabels ( std::vector< ParamInfo > &  p)
static

get information about the parameters, that are used in loadSubsetLabels().

The Infos are appended to the passed array

Parameters
parray of ParamInfos. The Infos will be appended to this array

Referenced by ~LoadSaveASCII().

◆ checkParamsForLoadSubsetLabels()

bool svt::LoadSaveASCII::checkParamsForLoadSubsetLabels ( StDataCmdLine cmdline) const

checks wether the "--subset_att" parameter was given.

Parameters
cmdlinecommand line
Returns
true: subset_att parameter was given

Referenced by ~LoadSaveASCII().

◆ loadSubsetLabels()

void svt::LoadSaveASCII::loadSubsetLabels ( StDataCmdLine cmdline,
std::vector< int > &  subsetIndexByUID 
)

load feature vectors

Parameters
cmdlinecommand line parameters
subsetIndexByUIDsubset Index by Unique ID, could be directly used for Cross-validati on
Exceptions
svt::LoadErrorfile could not be opened

Referenced by ~LoadSaveASCII().

◆ getParamInfosForSaveModel()

static void svt::LoadSaveASCII::getParamInfosForSaveModel ( std::vector< ParamInfo > &  p)
static

get information about the parameters, that are used in saveModel().

The Infos are appended to the passed array

Parameters
parray of ParamInfos. The Infos will be appended to this array

Referenced by ~LoadSaveASCII().

◆ checkParamsForSaveModel()

void svt::LoadSaveASCII::checkParamsForSaveModel ( StDataCmdLine cmdline) const

Just accesses all parameters, that are used in saveModel() so that they are no longer unknwon to StDataASCIIFile.

Parameters
cmdlinecommand line

Referenced by ~LoadSaveASCII().

◆ saveModel()

template<typename FV >
void svt::LoadSaveASCII::saveModel ( StDataCmdLine cmdline,
BasicSVMAdapter< FV, STDATA > *  svm,
int  detailLevel,
std::ostream &  os 
)

save Model.

Parameters
cmdlinecommand line parameters
svmthe trained SVM
detailLevelwether to save additional training infos to model. 0: nothing, 1: only statistics, 2: training infos from all two-class trainings
Exceptions
svt::SaveErroroutput file could not be created

Referenced by ~LoadSaveASCII().

◆ getParamInfosForCreateSVMAndLoadModel()

static void svt::LoadSaveASCII::getParamInfosForCreateSVMAndLoadModel ( std::vector< ParamInfo > &  p)
static

get information about the parameters, that are used in createSVMAndLoadModel().

The Infos are appended to the passed array

Parameters
parray of ParamInfos. The Infos will be appended to this array

Referenced by ~LoadSaveASCII().

◆ createSVMAndLoadModel()

template<typename FV , typename ALGORITHMS >
BasicSVMAdapter<FV,STDATA>* svt::LoadSaveASCII::createSVMAndLoadModel ( StDataCmdLine cmdline)

create SVM from file and load Model data

Parameters
cmdlinecommand line parameters
modelFileNamefile name of modelfile
svm(output)
Exceptions
svt::LoadErrorfile could not be opened
Returns
created SVM with loaded Model. The ownership of this object goes to caller. So you are responsible to delete it after usage

Referenced by ~LoadSaveASCII().

◆ getParamInfosForSaveClassificationResults()

static void svt::LoadSaveASCII::getParamInfosForSaveClassificationResults ( std::vector< ParamInfo > &  p)
static

get information about the parameters, that are used in createSVMAndLoadModel().

The Infos are appended to the passed array

Parameters
parray of ParamInfos. The Infos will be appended to this array

Referenced by ~LoadSaveASCII().

◆ checkParamsForSaveClassificationResults()

bool svt::LoadSaveASCII::checkParamsForSaveClassificationResults ( StDataCmdLine cmdline) const

Just accesses all parameters, that are used in saveClassificationResults() so that they are no longer unknwon to StDataASCIIFile.

Parameters
cmdlinecommand line

Referenced by ~LoadSaveASCII().

◆ saveClassificationResults()

void svt::LoadSaveASCII::saveClassificationResults ( StDataCmdLine cmdline,
const std::vector< double > &  results,
const std::vector< StDataASCII > &  details,
bool  saveDetails,
std::ostream &  os 
)

save classification results.

output file name is taken from cmdline parameters. If requested, classification details are saved to the extra file <outpufilename>_details in the format "<uid>_<key> <value>" one per line, where uid is the unique id of the feature vector and key, value the given key value pair from the given details-vector

Parameters
cmdlinethe command line
resultspredicted labels for each feature vector
detailsadditional classification details in key-value pairs for each feature vector
saveDetailswether to save the additional details in details vector
osoutput stream (usually std::cout) for additionally infos, like "saving ...", etc.

Referenced by ~LoadSaveASCII().


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