Class: Eps::PMML::Loader
- Inherits:
-
Object
- Object
- Eps::PMML::Loader
- Defined in:
- lib/eps/pmml/loader.rb
Instance Attribute Summary collapse
-
#data ⇒ Object
readonly
Returns the value of attribute data.
Instance Method Summary collapse
-
#initialize(pmml) ⇒ Loader
constructor
A new instance of Loader.
- #load ⇒ Object
Constructor Details
#initialize(pmml) ⇒ Loader
Returns a new instance of Loader.
6 7 8 9 10 11 |
# File 'lib/eps/pmml/loader.rb', line 6 def initialize(pmml) if pmml.is_a?(String) pmml = Nokogiri::XML(pmml) { |config| config.strict } end @data = pmml end |
Instance Attribute Details
#data ⇒ Object (readonly)
Returns the value of attribute data.
4 5 6 |
# File 'lib/eps/pmml/loader.rb', line 4 def data @data end |
Instance Method Details
#load ⇒ Object
13 14 15 16 17 18 19 20 21 22 23 |
# File 'lib/eps/pmml/loader.rb', line 13 def load if data.css("Segmentation").any? lightgbm elsif data.css("RegressionModel").any? linear_regression elsif data.css("NaiveBayesModel").any? naive_bayes else raise "Unknown model" end end |