GenSVM
|
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"
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 |
Command line interface for training and testing with a GenSVM model.
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.
#define MINARGS 2 |
Minimal number of command line arguments
Definition at line 40 of file GenSVMtraintest.c.
void exit_invalid_param | ( | const char * | label, |
char ** | argv | ||
) |
Exit with warning about invalid parameter value.
[in] | label | name of the parameter |
[in] | argv | command line arguments |
Definition at line 250 of file GenSVMtraintest.c.
void exit_with_help | ( | char ** | argv | ) |
Help function.
Print help for this program and exit. Note that the VERSION is defined in the Makefile.
[in] | argv | command line arguments |
Definition at line 62 of file GenSVMtraintest.c.
int main | ( | int | argc, |
char ** | argv | ||
) |
Main interface function for GenSVMtraintest.
Main interface for the GenSVMtraintest commandline program.
[in] | argc | number of command line arguments |
[in] | argv | array of command line arguments |
Definition at line 114 of file GenSVMtraintest.c.
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.
[in] | argc | number of command line arguments |
[in] | argv | array of command line arguments |
[in] | model | initialized GenModel struct |
[out] | model_inputfile | filename for the seed model |
[out] | training_inputfile | filename for the training data |
[out] | testing_inputfile | filename for the test data |
[out] | model_outputfile | filename for the output model |
[out] | prediction_outputfile | filename for the predictions |
Definition at line 275 of file GenSVMtraintest.c.
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.
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.