4 #define LIBLINEAR_VERSION 242
10 extern int liblinear_version;
22 struct feature_node **x;
23 double bias; /* < 0 if no bias term */
26 enum { L2R_LR, L2R_L2LOSS_SVC_DUAL, L2R_L2LOSS_SVC, L2R_L1LOSS_SVC_DUAL, MCSVM_CS, L1R_L2LOSS_SVC, L1R_LR, L2R_LR_DUAL, L2R_L2LOSS_SVR = 11, L2R_L2LOSS_SVR_DUAL, L2R_L1LOSS_SVR_DUAL, ONECLASS_SVM = 21 }; /* solver_type */
32 /* these are for training only */
33 double eps; /* stopping tolerance */
46 struct parameter param;
47 int nr_class; /* number of classes */
50 int *label; /* label of each class */
52 double rho; /* one-class SVM only */
55 struct model* train(const struct problem *prob, const struct parameter *param);
56 void cross_validation(const struct problem *prob, const struct parameter *param, int nr_fold, double *target);
57 void find_parameters(const struct problem *prob, const struct parameter *param, int nr_fold, double start_C, double start_p, double *best_C, double *best_p, double *best_score);
59 double predict_values(const struct model *model_, const struct feature_node *x, double* dec_values);
60 double predict(const struct model *model_, const struct feature_node *x);
61 double predict_probability(const struct model *model_, const struct feature_node *x, double* prob_estimates);
63 int save_model(const char *model_file_name, const struct model *model_);
64 struct model *load_model(const char *model_file_name);
66 int get_nr_feature(const struct model *model_);
67 int get_nr_class(const struct model *model_);
68 void get_labels(const struct model *model_, int* label);
69 double get_decfun_coef(const struct model *model_, int feat_idx, int label_idx);
70 double get_decfun_bias(const struct model *model_, int label_idx);
71 double get_decfun_rho(const struct model *model_);
73 void free_model_content(struct model *model_ptr);
74 void free_and_destroy_model(struct model **model_ptr_ptr);
75 void destroy_param(struct parameter *param);
77 const char *check_parameter(const struct problem *prob, const struct parameter *param);
78 int check_probability_model(const struct model *model);
79 int check_regression_model(const struct model *model);
80 int check_oneclass_model(const struct model *model);
81 void set_print_string_function(void (*print_func) (const char*));
87 #endif /* _LIBLINEAR_H */