lib/eps/model.rb in eps-0.3.0 vs lib/eps/model.rb in eps-0.3.1
- old
+ new
@@ -15,15 +15,15 @@
data = Nokogiri::XML(data) { |config| config.strict }
end
estimator_class =
if data.css("Segmentation").any?
- Eps::LightGBM
+ LightGBM
elsif data.css("RegressionModel").any?
- Eps::LinearRegression
+ LinearRegression
elsif data.css("NaiveBayesModel").any?
- Eps::NaiveBayes
+ NaiveBayes
else
raise "Unknown model"
end
new(estimator: estimator_class.load_pmml(data))
@@ -33,14 +33,14 @@
def train(data, y = nil, target: nil, algorithm: :lightgbm, **options)
estimator_class =
case algorithm
when :lightgbm
- Eps::LightGBM
+ LightGBM
when :linear_regression
- Eps::LinearRegression
+ LinearRegression
when :naive_bayes
- Eps::NaiveBayes
+ NaiveBayes
else
raise ArgumentError, "Unknown algorithm: #{algorithm}"
end
@estimator = estimator_class.new(data, y, target: target, **options)