#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <math.h>
#include <assert.h>
#include <stdint.h>
#include "Perceptron.h"
#include "../msg.c"
#include "../bio/mkSfx.c"
#include "../bio/new.c"
#include "../bio/ch2Id.c"
#include "../bio/save.c"
#include "../bio/find.c"
#include "../bio/mapP.c"
#include "../bio/del.c"
#include "../hash/nps_vocab.c"
#include "../imat/InstMatLoL.c"
#include "../hash/Intern.c"
#include "../num/blas/level1/cblas_daxpy.c"
#include "../num/blas/level1/cblas_dscal.c"
#include "../num/permute.c"
int nps_initPercModel | ( | nps_error_t * | err | ) |
struct Nps_PercModel* nps_newPercModel | ( | nps_error_t * | err, | |
struct Nps_Intern * | featDict, | |||
struct Nps_Intern * | labDict, | |||
char | ignoreBias | |||
) | [read] |
struct Nps_PercModel* nps_PercModel_ctor | ( | struct Nps_PercModel * | o, | |
nps_error_t * | error, | |||
va_list * | app | |||
) | [read] |
int nps_PercModel_dtor | ( | struct Nps_PercModel * | o, | |
nps_error_t * | err | |||
) |
struct Nps_PercModel* nps_PercModel_FromModelDir | ( | nps_error_t * | err, | |
const char *const | model_dir | |||
) | [read] |
double nps_PercModel_predict | ( | struct Nps_PercModel * | o, | |
s8f8_svec_t * | svec | |||
) |
struct nps_avgperc_t* perc_model_avg_alloc | ( | int64_t | numFeats, | |
int64_t | numCats | |||
) | [read] |
void perc_model_avg_free | ( | struct nps_avgperc_t * | o | ) |
int perc_model_binary_train | ( | struct Nps_PercModel * | o, | |
nps_error_t * | e, | |||
struct nps_InstMatLoL * | mat, | |||
int64_t | maxIterations | |||
) |
perc_model_binary_train implements the training procedure for the averaged perceptron. The averaged perceptron is a variant of the voted perceptron that was introduced in: Freund, Y. and Schapire, R. E. 1999. Large margin classification using the perceptron algorithm. In Machine Learning 37(3):277-296, 1999.
It is a good idea to normalize mat before calling this procedure.
void perc_model_del | ( | perc_model_t * | o | ) |
double perc_model_error | ( | struct Nps_PercModel * | o, | |
double * | test_weights, | |||
int64_t | biasIndex, | |||
struct nps_InstMatLoL * | mat | |||
) |
int perc_model_multi_cat_train | ( | struct Nps_PercModel * | o, | |
nps_error_t * | e, | |||
struct nps_InstMatLoL * | mat, | |||
int64_t | maxIterations | |||
) |
int perc_model_save | ( | struct Nps_PercModel * | o, | |
const char * | root, | |||
nps_error_t * | err | |||
) |
struct Nps_PercModel* Nps_PercModel |