Class: Eps::PMML::Generator

Inherits:
Object
  • Object
show all
Defined in:
lib/eps/pmml/generator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(model) ⇒ Generator

Returns a new instance of Generator.



6
7
8
# File 'lib/eps/pmml/generator.rb', line 6

def initialize(model)
  @model = model
end

Instance Attribute Details

#modelObject (readonly)

Returns the value of attribute model.



4
5
6
# File 'lib/eps/pmml/generator.rb', line 4

def model
  @model
end

Instance Method Details

#generateObject



10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/eps/pmml/generator.rb', line 10

def generate
  case @model
  when LightGBM
    lightgbm
  when LinearRegression
    linear_regression
  when NaiveBayes
    naive_bayes
  else
    raise "Unknown model"
  end
end