Module: ML::Learner::LinearToolbox
- Included in:
- CyclicDescentLearner, LinearRegressionLearner, LogisticRegressionLearner, PerceptronLearner
- Defined in:
- lib/method/toolbox.rb
Overview
Learner toolbox for linear model
The prediction is a vector of dimension d+1 where d is the dimension of the input data
Instance Attribute Summary collapse
-
#current_vector ⇒ Object
Current prediction vector.
Instance Method Summary collapse
-
#line ⇒ Array
The final coefficient of the line.
-
#predict(data) ⇒ Integer
Predict certain data.
Instance Attribute Details
#current_vector ⇒ Object
Current prediction vector
38 39 40 |
# File 'lib/method/toolbox.rb', line 38 def current_vector @current_vector end |
Instance Method Details
#line ⇒ Array
The final coefficient of the line
51 52 53 |
# File 'lib/method/toolbox.rb', line 51 def line current_vector.column(0).to_a end |
#predict(data) ⇒ Integer
Predict certain data
44 45 46 |
# File 'lib/method/toolbox.rb', line 44 def predict data classify_bool Matrix.column_vector(data) end |