#----------------------------------------------------------- extern declarations cdef extern from "Python.h": object PyString_FromStringAndSize (char * s, int len) cdef extern from "string.h": int strlen(char *) cdef extern from "stdlib.h": ctypedef unsigned long size_t void free(void *ptr) void *malloc(size_t size) cdef extern from "stdio.h": void printf(char *, ...) cdef extern from "liblinear-1.32/linear.h": cdef extern int verbose_ cdef struct feature_node: int index double value cdef struct problem: int l, n, *y feature_node **x double bias cdef struct parameter: int solver_type # /* these are for training only */ double eps #/* stopping criteria */ double C int nr_weight int *weight_label double* weight cdef struct model: parameter param int nr_class #/* number of classes */ int nr_feature double *w int *label #/* label of each class (label[n]) */ double bias char *check_parameter( problem *prob, parameter *param) model *train(problem *prob, parameter *param, int verbose) int predict(model *model_, feature_node *x) int predict_values(model *model_, feature_node *x, double *) int predict_probability(model *model_, feature_node *x, double* ) void cross_validation(problem *prob, parameter *param, int nr_fold, int *target, int verbose) char * to_string(model * model_) model * from_string(char *)