LIBIRWLS
|
Input and Output structures and procedures. More...
#include <stdio.h>
Go to the source code of this file.
Data Structures | |
struct | properties |
Training parameters of the IRWLS procedures. More... | |
struct | predictProperties |
Testing parameters of the IRWLS procedures. More... | |
struct | model |
It represents a trained model that has been obtained using PIRWLS or PSIRWLS. More... | |
struct | svm_sample |
A single feature of a data. More... | |
struct | svm_dataset |
A dataset. More... | |
Typedefs | |
typedef struct properties | properties |
Training parameters of the IRWLS procedures. More... | |
typedef struct predictProperties | predictProperties |
Testing parameters of the IRWLS procedures. More... | |
typedef struct model | model |
It represents a trained model that has been obtained using PIRWLS or PSIRWLS. More... | |
typedef struct svm_sample | svm_sample |
A single feature of a data. More... | |
typedef struct svm_dataset | svm_dataset |
A dataset. More... | |
Functions | |
void | freeDataset (svm_dataset data) |
Free dataset memory. More... | |
void | freeModel (model modelo) |
Free model memory. More... | |
svm_dataset | readTrainFile (char filename[]) |
It reads a file that contains a labeled dataset in libsvm format. More... | |
svm_dataset | readUnlabeledFile (char filename[]) |
It reads a file that contains an unlabeled dataset in libsvm format. More... | |
void | storeModel (model *mod, FILE *Output) |
It stores a trained model into a file. More... | |
void | readModel (model *mod, FILE *Input) |
It loads a trained model from a file. More... | |
void | writeOutput (char fileoutput[], double *predictions, int size) |
It writes the content of a double array into a file. More... | |
Input and Output structures and procedures.
It represents a trained model that has been obtained using PIRWLS or PSIRWLS.
This structures saves all the variables of a trained model needed to classify future data.
typedef struct predictProperties predictProperties |
Testing parameters of the IRWLS procedures.
This struct stores the testing parameters of the IRWLS procedures.
typedef struct properties properties |
Training parameters of the IRWLS procedures.
This struct stores the training parameters of the IRWLS procedures.
typedef struct svm_dataset svm_dataset |
A dataset.
This structure represents a dataset, a collection of samples and its associated labels.
typedef struct svm_sample svm_sample |
A single feature of a data.
This structure represents a single feature of a data. It is composed of a features index and its value.
void freeDataset | ( | svm_dataset | data | ) |
Free dataset memory.
Free memory allocated by a dataset.
data | The dataset |
void freeModel | ( | model | modelo | ) |
Free model memory.
Free memory allocated by a model.
data | The model |
void readModel | ( | model * | mod, |
FILE * | Input | ||
) |
It loads a trained model from a file.
It loads a trained model (that has been obtained using PIRWLS or PSIRWLS) from a file.
mod | The pointer with the struct to load results. |
Input | The name of the file. |
svm_dataset readTrainFile | ( | char | filename[] | ) |
It reads a file that contains a labeled dataset in libsvm format.
It reads a file that contains a labeled dataset in libsvm format, the format is the following one: +1 1:5 7:2 15:6 +1 1:5 7:2 15:6 23:1 -1 2:4 3:2 10:6 11:4 ...
filename | A string with the name of the file that contains the dataset. |
svm_dataset readUnlabeledFile | ( | char | filename[] | ) |
It reads a file that contains an unlabeled dataset in libsvm format.
It reads a file that contains an unlabeled dataset in libsvm format. The format si the following one: 1:5 7:2 15:6 1:5 7:2 15:6 23:1 2:4 3:2 10:6 11:4 ...
filename | A string with the name of the file that contains the dataset. |
void storeModel | ( | model * | mod, |
FILE * | Output | ||
) |
It stores a trained model into a file.
It stores the struct of a trained model (that has been obtained using PIRWLS or PSIRWLS) into a file.
mod | The struct with the model to store. |
Output | The name of the file. |
void writeOutput | ( | char | fileoutput[], |
double * | predictions, | ||
int | size | ||
) |
It writes the content of a double array into a file.
It writes the content of a double array into a file. It is used to save the predictions of a model on a dataset.
fileoutput | The name of the file. |
predictions | The array with the information to save. |
size | The length of the array. |