00001 #ifndef L1_LOGREG_H
00002 #define L1_LOGREG_H
00003
00004 #include "dmatrix.h"
00005
00006 #ifdef __cplusplus
00007 extern "C" {
00008 #endif
00009
00010
00011 #define STATUS_SOLUTION_FOUND 0
00012 #define STATUS_MAX_NT_ITER_EXCEEDED -1
00013 #define STATUS_MAX_LS_ITER_EXCEEDED -2
00014
00015 typedef struct {
00016 int sflag;
00017 int cflag;
00018 int verbose_level;
00019 double tolerance;
00020 double ktolerance;
00021 } train_opts;
00022
00023 int
00024 l1_logreg_train(dmatrix *X, double *b, double lambda, train_opts to,
00025 double *initial_x, double *initial_t, double *sol,
00026 int *total_ntiter, int *total_pcgiter);
00027
00028
00029 #define STATUS_OK 0
00030 #define STATUS_ERROR -1
00031
00032 int
00033 l1_logreg_classify(dmatrix * matX, double *b, double *sol,
00034 int pflag, double *result, int *error_count);
00035
00036
00037 #ifdef __cplusplus
00038 }
00039 #endif
00040
00041 #endif
00042