liblinear-ruby 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +141 -10
- data/{liblinear-1.93/ruby → ext}/liblinear.i +0 -0
- data/ext/linear.cpp +30 -7
- data/ext/tron.cpp +4 -4
- data/lib/liblinear/model.rb +3 -3
- data/lib/liblinear/parameter.rb +2 -2
- data/lib/liblinear/problem.rb +4 -17
- data/lib/liblinear/version.rb +1 -1
- data/lib/liblinear.rb +46 -13
- data/{liblinear-1.93 → liblinear-1.94}/COPYRIGHT +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/Makefile +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/Makefile.win +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/README +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/Makefile +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/blas.h +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/blasp.h +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/daxpy.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/ddot.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/dnrm2.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/blas/dscal.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/heart_scale +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/linear.cpp +30 -7
- data/{liblinear-1.93 → liblinear-1.94}/linear.def +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/linear.h +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/matlab/Makefile +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/matlab/README +2 -1
- data/{liblinear-1.93 → liblinear-1.94}/matlab/libsvmread.c +25 -24
- data/{liblinear-1.93 → liblinear-1.94}/matlab/libsvmwrite.c +15 -1
- data/{liblinear-1.93 → liblinear-1.94}/matlab/linear_model_matlab.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/matlab/linear_model_matlab.h +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/matlab/make.m +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/matlab/predict.c +37 -25
- data/{liblinear-1.93 → liblinear-1.94}/matlab/train.c +16 -7
- data/{liblinear-1.93 → liblinear-1.94}/predict.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/python/Makefile +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/python/README +1 -1
- data/{liblinear-1.93 → liblinear-1.94}/python/liblinear.py +1 -1
- data/{liblinear-1.93 → liblinear-1.94}/python/liblinearutil.py +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/train.c +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/tron.cpp +4 -4
- data/{liblinear-1.93 → liblinear-1.94}/tron.h +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/windows/liblinear.dll +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/windows/libsvmread.mexw64 +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/windows/libsvmwrite.mexw64 +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/windows/predict.exe +0 -0
- data/liblinear-1.94/windows/predict.mexw64 +0 -0
- data/{liblinear-1.93 → liblinear-1.94}/windows/train.exe +0 -0
- data/liblinear-1.94/windows/train.mexw64 +0 -0
- data/spec/liblinear/model_spec.rb +56 -0
- data/spec/liblinear/parameter_spec.rb +57 -0
- data/spec/liblinear/problem_spec.rb +23 -0
- data/spec/liblinear_spec.rb +104 -0
- metadata +51 -56
- data/ext/linear.rb +0 -357
- data/liblinear-1.93/blas/blas.a +0 -0
- data/liblinear-1.93/blas/daxpy.o +0 -0
- data/liblinear-1.93/blas/ddot.o +0 -0
- data/liblinear-1.93/blas/dnrm2.o +0 -0
- data/liblinear-1.93/blas/dscal.o +0 -0
- data/liblinear-1.93/linear.o +0 -0
- data/liblinear-1.93/predict +0 -0
- data/liblinear-1.93/ruby/liblinear_wrap.cxx +0 -4646
- data/liblinear-1.93/ruby/linear.h +0 -74
- data/liblinear-1.93/ruby/linear.o +0 -0
- data/liblinear-1.93/train +0 -0
- data/liblinear-1.93/tron.o +0 -0
- data/liblinear-1.93/windows/predict.mexw64 +0 -0
- data/liblinear-1.93/windows/train.mexw64 +0 -0
@@ -1,74 +0,0 @@
|
|
1
|
-
#ifndef _LIBLINEAR_H
|
2
|
-
#define _LIBLINEAR_H
|
3
|
-
|
4
|
-
#ifdef __cplusplus
|
5
|
-
extern "C" {
|
6
|
-
#endif
|
7
|
-
|
8
|
-
struct feature_node
|
9
|
-
{
|
10
|
-
int index;
|
11
|
-
double value;
|
12
|
-
};
|
13
|
-
|
14
|
-
struct problem
|
15
|
-
{
|
16
|
-
int l, n;
|
17
|
-
double *y;
|
18
|
-
struct feature_node **x;
|
19
|
-
double bias; /* < 0 if no bias term */
|
20
|
-
};
|
21
|
-
|
22
|
-
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 }; /* solver_type */
|
23
|
-
|
24
|
-
struct parameter
|
25
|
-
{
|
26
|
-
int solver_type;
|
27
|
-
|
28
|
-
/* these are for training only */
|
29
|
-
double eps; /* stopping criteria */
|
30
|
-
double C;
|
31
|
-
int nr_weight;
|
32
|
-
int *weight_label;
|
33
|
-
double* weight;
|
34
|
-
double p;
|
35
|
-
};
|
36
|
-
|
37
|
-
struct model
|
38
|
-
{
|
39
|
-
struct parameter param;
|
40
|
-
int nr_class; /* number of classes */
|
41
|
-
int nr_feature;
|
42
|
-
double *w;
|
43
|
-
int *label; /* label of each class */
|
44
|
-
double bias;
|
45
|
-
};
|
46
|
-
|
47
|
-
struct model* train(const struct problem *prob, const struct parameter *param);
|
48
|
-
void cross_validation(const struct problem *prob, const struct parameter *param, int nr_fold, double *target);
|
49
|
-
|
50
|
-
double predict_values(const struct model *model_, const struct feature_node *x, double* dec_values);
|
51
|
-
double predict(const struct model *model_, const struct feature_node *x);
|
52
|
-
double predict_probability(const struct model *model_, const struct feature_node *x, double* prob_estimates);
|
53
|
-
|
54
|
-
int save_model(const char *model_file_name, const struct model *model_);
|
55
|
-
struct model *load_model(const char *model_file_name);
|
56
|
-
|
57
|
-
int get_nr_feature(const struct model *model_);
|
58
|
-
int get_nr_class(const struct model *model_);
|
59
|
-
void get_labels(const struct model *model_, int* label);
|
60
|
-
|
61
|
-
void free_model_content(struct model *model_ptr);
|
62
|
-
void free_and_destroy_model(struct model **model_ptr_ptr);
|
63
|
-
void destroy_param(struct parameter *param);
|
64
|
-
|
65
|
-
const char *check_parameter(const struct problem *prob, const struct parameter *param);
|
66
|
-
int check_probability_model(const struct model *model);
|
67
|
-
void set_print_string_function(void (*print_func) (const char*));
|
68
|
-
|
69
|
-
#ifdef __cplusplus
|
70
|
-
}
|
71
|
-
#endif
|
72
|
-
|
73
|
-
#endif /* _LIBLINEAR_H */
|
74
|
-
|
Binary file
|
data/liblinear-1.93/train
DELETED
Binary file
|
data/liblinear-1.93/tron.o
DELETED
Binary file
|
Binary file
|
Binary file
|