Class: MLRuby::DecisionTreeClassifier::Model
- Inherits:
-
Object
- Object
- MLRuby::DecisionTreeClassifier::Model
- Defined in:
- lib/ML_Ruby.rb
Instance Method Summary collapse
-
#initialize(data) ⇒ Model
constructor
A new instance of Model.
- #predict(next_x) ⇒ Object
Constructor Details
#initialize(data) ⇒ Model
Returns a new instance of Model.
52 53 54 |
# File 'lib/ML_Ruby.rb', line 52 def initialize(data) @data = data end |
Instance Method Details
#predict(next_x) ⇒ Object
55 56 57 58 59 |
# File 'lib/ML_Ruby.rb', line 55 def predict(next_x) script_path = "#{Gem.loaded_specs['ML_Ruby'].gem_dir}/lib/python/decision_tree_classifier.py" result = `#{MLRuby::PYTHON_PATH} #{script_path} "#{@data}, #{next_x}"` result.to_i end |