GenSVM
Macros | Functions | Variables
GenSVMtraintest.c File Reference

Command line interface for training and testing with a GenSVM model. More...

#include "gensvm_checks.h"
#include "gensvm_cmdarg.h"
#include "gensvm_io.h"
#include "gensvm_train.h"
#include "gensvm_predict.h"
Include dependency graph for GenSVMtraintest.c:

Go to the source code of this file.

Macros

#define MINARGS   2
 

Functions

void exit_with_help (char **argv)
 Help function. More...
 
void parse_command_line (int argc, char **argv, struct GenModel *model, char **model_inputfile, char **training_inputfile, char **testing_inputfile, char **model_outputfile, char **prediction_outputfile)
 Parse the command line arguments. More...
 
int main (int argc, char **argv)
 Main interface function for GenSVMtraintest. More...
 
void exit_invalid_param (const char *label, char **argv)
 Exit with warning about invalid parameter value. More...
 

Variables

FILE * GENSVM_OUTPUT_FILE
 
FILE * GENSVM_ERROR_FILE
 

Detailed Description

Command line interface for training and testing with a GenSVM model.

Author
G.J.J. van den Burg
Date
2015-02-01

This is a command line program for training and testing on a single model with specified model parameters.

This file is part of GenSVM.

GenSVM is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

GenSVM is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with GenSVM. If not, see http://www.gnu.org/licenses/.

Definition in file GenSVMtraintest.c.

Macro Definition Documentation

◆ MINARGS

#define MINARGS   2

Minimal number of command line arguments

Definition at line 40 of file GenSVMtraintest.c.

Function Documentation

◆ exit_invalid_param()

void exit_invalid_param ( const char *  label,
char **  argv 
)

Exit with warning about invalid parameter value.

Parameters
[in]labelname of the parameter
[in]argvcommand line arguments

Definition at line 250 of file GenSVMtraintest.c.

Here is the call graph for this function:

◆ exit_with_help()

void exit_with_help ( char **  argv)

Help function.

Print help for this program and exit. Note that the VERSION is defined in the Makefile.

Parameters
[in]argvcommand line arguments

Definition at line 62 of file GenSVMtraintest.c.

◆ main()

int main ( int  argc,
char **  argv 
)

Main interface function for GenSVMtraintest.

Main interface for the GenSVMtraintest commandline program.

Parameters
[in]argcnumber of command line arguments
[in]argvarray of command line arguments
Returns
exit status

Definition at line 114 of file GenSVMtraintest.c.

Here is the call graph for this function:

◆ parse_command_line()

void parse_command_line ( int  argc,
char **  argv,
struct GenModel model,
char **  model_inputfile,
char **  training_inputfile,
char **  testing_inputfile,
char **  model_outputfile,
char **  prediction_outputfile 
)

Parse the command line arguments.

For a full overview of the command line arguments and their meaning see exit_with_help(). This function furthermore sets the default output streams to stdout/stderr, and initializes the kernel parameters if none are supplied: gamma = 1.0, degree = 2.0, coef = 0.0.

Parameters
[in]argcnumber of command line arguments
[in]argvarray of command line arguments
[in]modelinitialized GenModel struct
[out]model_inputfilefilename for the seed model
[out]training_inputfilefilename for the training data
[out]testing_inputfilefilename for the test data
[out]model_outputfilefilename for the output model
[out]prediction_outputfilefilename for the predictions

Definition at line 275 of file GenSVMtraintest.c.

Here is the call graph for this function:

Variable Documentation

◆ GENSVM_ERROR_FILE

FILE* GENSVM_ERROR_FILE

The GENSVM_ERROR_FILE specifies the output stream to use when writing an error. Typically this is stderr, but when unit testing we can temporarily redirect this to check if the correct output is written.

Definition at line 43 of file gensvm_print.c.

◆ GENSVM_OUTPUT_FILE

FILE* GENSVM_OUTPUT_FILE

The GENSVM_OUTPUT_FILE specifies the output stream to which all output is written. This is done through the function note(). The advantage of using a global output stream variable is that the output can temporarily be suppressed by importing this variable through extern and (temporarily) setting it to NULL.

Definition at line 33 of file gensvm_print.c.