ml4r 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
@@ -18,18 +18,6 @@ using std::vector;
|
|
18
18
|
using ublas::prod;
|
19
19
|
using ublas::matrix;
|
20
20
|
|
21
|
-
|
22
|
-
void LinearRegression::setWeights(vector<double> weights)
|
23
|
-
{
|
24
|
-
m_ws = weights;
|
25
|
-
}
|
26
|
-
|
27
|
-
void LinearRegression::setFixedConstant(double val)
|
28
|
-
{
|
29
|
-
m_constant = val;
|
30
|
-
m_constantIsFixed = true;
|
31
|
-
}
|
32
|
-
|
33
21
|
pair<vector<double>,double> LinearRegression::getParameterEstimates()
|
34
22
|
{
|
35
23
|
return make_pair(m_bs,m_constant);
|
@@ -28,10 +28,6 @@ public:
|
|
28
28
|
: m_xs(xs), m_ys(ys), m_ws(weights), m_constantIsFixed(true), m_constant(fixedConstant), m_paramsAreValid(false) {}
|
29
29
|
~LinearRegression() {}
|
30
30
|
|
31
|
-
|
32
|
-
void setFixedConstant(double val);
|
33
|
-
|
34
|
-
|
35
31
|
pair<std::vector<double>,double> getParameterEstimates();
|
36
32
|
std::vector<double>& getFittedYs();
|
37
33
|
std::vector<double>& getPredictedYs();
|
data/ext/ml4r/ml4r_wrap.cpp
CHANGED
@@ -13945,35 +13945,6 @@ free_LinearRegression(LinearRegression *arg1) {
|
|
13945
13945
|
delete arg1;
|
13946
13946
|
}
|
13947
13947
|
|
13948
|
-
SWIGINTERN VALUE
|
13949
|
-
_wrap_LinearRegression_setFixedConstant(int argc, VALUE *argv, VALUE self) {
|
13950
|
-
LinearRegression *arg1 = (LinearRegression *) 0 ;
|
13951
|
-
double arg2 ;
|
13952
|
-
void *argp1 = 0 ;
|
13953
|
-
int res1 = 0 ;
|
13954
|
-
double val2 ;
|
13955
|
-
int ecode2 = 0 ;
|
13956
|
-
|
13957
|
-
if ((argc < 1) || (argc > 1)) {
|
13958
|
-
rb_raise(rb_eArgError, "wrong # of arguments(%d for 1)",argc); SWIG_fail;
|
13959
|
-
}
|
13960
|
-
res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_LinearRegression, 0 | 0 );
|
13961
|
-
if (!SWIG_IsOK(res1)) {
|
13962
|
-
SWIG_exception_fail(SWIG_ArgError(res1), Ruby_Format_TypeError( "", "LinearRegression *","setFixedConstant", 1, self ));
|
13963
|
-
}
|
13964
|
-
arg1 = reinterpret_cast< LinearRegression * >(argp1);
|
13965
|
-
ecode2 = SWIG_AsVal_double(argv[0], &val2);
|
13966
|
-
if (!SWIG_IsOK(ecode2)) {
|
13967
|
-
SWIG_exception_fail(SWIG_ArgError(ecode2), Ruby_Format_TypeError( "", "double","setFixedConstant", 2, argv[0] ));
|
13968
|
-
}
|
13969
|
-
arg2 = static_cast< double >(val2);
|
13970
|
-
(arg1)->setFixedConstant(arg2);
|
13971
|
-
return Qnil;
|
13972
|
-
fail:
|
13973
|
-
return Qnil;
|
13974
|
-
}
|
13975
|
-
|
13976
|
-
|
13977
13948
|
SWIGINTERN VALUE
|
13978
13949
|
_wrap_LinearRegression_getParameterEstimates(int argc, VALUE *argv, VALUE self) {
|
13979
13950
|
LinearRegression *arg1 = (LinearRegression *) 0 ;
|
@@ -15692,7 +15663,6 @@ SWIGEXPORT void Init_ml4r(void) {
|
|
15692
15663
|
SWIG_TypeClientData(SWIGTYPE_p_LinearRegression, (void *) &SwigClassLinearRegression);
|
15693
15664
|
rb_define_alloc_func(SwigClassLinearRegression.klass, _wrap_LinearRegression_allocate);
|
15694
15665
|
rb_define_method(SwigClassLinearRegression.klass, "initialize", VALUEFUNC(_wrap_new_LinearRegression), -1);
|
15695
|
-
rb_define_method(SwigClassLinearRegression.klass, "setFixedConstant", VALUEFUNC(_wrap_LinearRegression_setFixedConstant), -1);
|
15696
15666
|
rb_define_method(SwigClassLinearRegression.klass, "getParameterEstimates", VALUEFUNC(_wrap_LinearRegression_getParameterEstimates), -1);
|
15697
15667
|
rb_define_method(SwigClassLinearRegression.klass, "getFittedYs", VALUEFUNC(_wrap_LinearRegression_getFittedYs), -1);
|
15698
15668
|
rb_define_method(SwigClassLinearRegression.klass, "getPredictedYs", VALUEFUNC(_wrap_LinearRegression_getPredictedYs), -1);
|