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.
Files changed (69) hide show
  1. checksums.yaml +4 -4
  2. data/README.md +141 -10
  3. data/{liblinear-1.93/ruby → ext}/liblinear.i +0 -0
  4. data/ext/linear.cpp +30 -7
  5. data/ext/tron.cpp +4 -4
  6. data/lib/liblinear/model.rb +3 -3
  7. data/lib/liblinear/parameter.rb +2 -2
  8. data/lib/liblinear/problem.rb +4 -17
  9. data/lib/liblinear/version.rb +1 -1
  10. data/lib/liblinear.rb +46 -13
  11. data/{liblinear-1.93 → liblinear-1.94}/COPYRIGHT +0 -0
  12. data/{liblinear-1.93 → liblinear-1.94}/Makefile +0 -0
  13. data/{liblinear-1.93 → liblinear-1.94}/Makefile.win +0 -0
  14. data/{liblinear-1.93 → liblinear-1.94}/README +0 -0
  15. data/{liblinear-1.93 → liblinear-1.94}/blas/Makefile +0 -0
  16. data/{liblinear-1.93 → liblinear-1.94}/blas/blas.h +0 -0
  17. data/{liblinear-1.93 → liblinear-1.94}/blas/blasp.h +0 -0
  18. data/{liblinear-1.93 → liblinear-1.94}/blas/daxpy.c +0 -0
  19. data/{liblinear-1.93 → liblinear-1.94}/blas/ddot.c +0 -0
  20. data/{liblinear-1.93 → liblinear-1.94}/blas/dnrm2.c +0 -0
  21. data/{liblinear-1.93 → liblinear-1.94}/blas/dscal.c +0 -0
  22. data/{liblinear-1.93 → liblinear-1.94}/heart_scale +0 -0
  23. data/{liblinear-1.93 → liblinear-1.94}/linear.cpp +30 -7
  24. data/{liblinear-1.93 → liblinear-1.94}/linear.def +0 -0
  25. data/{liblinear-1.93 → liblinear-1.94}/linear.h +0 -0
  26. data/{liblinear-1.93 → liblinear-1.94}/matlab/Makefile +0 -0
  27. data/{liblinear-1.93 → liblinear-1.94}/matlab/README +2 -1
  28. data/{liblinear-1.93 → liblinear-1.94}/matlab/libsvmread.c +25 -24
  29. data/{liblinear-1.93 → liblinear-1.94}/matlab/libsvmwrite.c +15 -1
  30. data/{liblinear-1.93 → liblinear-1.94}/matlab/linear_model_matlab.c +0 -0
  31. data/{liblinear-1.93 → liblinear-1.94}/matlab/linear_model_matlab.h +0 -0
  32. data/{liblinear-1.93 → liblinear-1.94}/matlab/make.m +0 -0
  33. data/{liblinear-1.93 → liblinear-1.94}/matlab/predict.c +37 -25
  34. data/{liblinear-1.93 → liblinear-1.94}/matlab/train.c +16 -7
  35. data/{liblinear-1.93 → liblinear-1.94}/predict.c +0 -0
  36. data/{liblinear-1.93 → liblinear-1.94}/python/Makefile +0 -0
  37. data/{liblinear-1.93 → liblinear-1.94}/python/README +1 -1
  38. data/{liblinear-1.93 → liblinear-1.94}/python/liblinear.py +1 -1
  39. data/{liblinear-1.93 → liblinear-1.94}/python/liblinearutil.py +0 -0
  40. data/{liblinear-1.93 → liblinear-1.94}/train.c +0 -0
  41. data/{liblinear-1.93 → liblinear-1.94}/tron.cpp +4 -4
  42. data/{liblinear-1.93 → liblinear-1.94}/tron.h +0 -0
  43. data/{liblinear-1.93 → liblinear-1.94}/windows/liblinear.dll +0 -0
  44. data/{liblinear-1.93 → liblinear-1.94}/windows/libsvmread.mexw64 +0 -0
  45. data/{liblinear-1.93 → liblinear-1.94}/windows/libsvmwrite.mexw64 +0 -0
  46. data/{liblinear-1.93 → liblinear-1.94}/windows/predict.exe +0 -0
  47. data/liblinear-1.94/windows/predict.mexw64 +0 -0
  48. data/{liblinear-1.93 → liblinear-1.94}/windows/train.exe +0 -0
  49. data/liblinear-1.94/windows/train.mexw64 +0 -0
  50. data/spec/liblinear/model_spec.rb +56 -0
  51. data/spec/liblinear/parameter_spec.rb +57 -0
  52. data/spec/liblinear/problem_spec.rb +23 -0
  53. data/spec/liblinear_spec.rb +104 -0
  54. metadata +51 -56
  55. data/ext/linear.rb +0 -357
  56. data/liblinear-1.93/blas/blas.a +0 -0
  57. data/liblinear-1.93/blas/daxpy.o +0 -0
  58. data/liblinear-1.93/blas/ddot.o +0 -0
  59. data/liblinear-1.93/blas/dnrm2.o +0 -0
  60. data/liblinear-1.93/blas/dscal.o +0 -0
  61. data/liblinear-1.93/linear.o +0 -0
  62. data/liblinear-1.93/predict +0 -0
  63. data/liblinear-1.93/ruby/liblinear_wrap.cxx +0 -4646
  64. data/liblinear-1.93/ruby/linear.h +0 -74
  65. data/liblinear-1.93/ruby/linear.o +0 -0
  66. data/liblinear-1.93/train +0 -0
  67. data/liblinear-1.93/tron.o +0 -0
  68. data/liblinear-1.93/windows/predict.mexw64 +0 -0
  69. 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
Binary file
Binary file
Binary file