Sha256: 468aae26044c39d6011a67467faa736daf66cb2e8011169f48286a06d3bff8a8

Contents?: true

Size: 1.16 KB

Versions: 11

Compression:

Stored size: 1.16 KB

Contents

# dependencies
require "json"
require "lightgbm"
require "matrix"
require "nokogiri"

# modules
require "eps/base"
require "eps/base_estimator"
require "eps/data_frame"
require "eps/label_encoder"
require "eps/lightgbm"
require "eps/linear_regression"
require "eps/metrics"
require "eps/model"
require "eps/naive_bayes"
require "eps/statistics"
require "eps/text_encoder"
require "eps/utils"
require "eps/version"

# pmml
require "eps/pmml"
require "eps/pmml/generator"
require "eps/pmml/loader"

# evaluators
require "eps/evaluators/linear_regression"
require "eps/evaluators/lightgbm"
require "eps/evaluators/naive_bayes"
require "eps/evaluators/node"

module Eps
  class Error < StandardError; end
  class UnstableSolution < Error; end

  def self.metrics(y_true, y_pred, weight: nil)
    if Utils.column_type(y_true, "actual") == "numeric"
      {
        rmse: Metrics.rmse(y_true, y_pred, weight: weight),
        mae: Metrics.mae(y_true, y_pred, weight: weight),
        me: Metrics.me(y_true, y_pred, weight: weight)
      }
    else
      {
        accuracy: Metrics.accuracy(y_true, y_pred, weight: weight)
      }
    end
  end

  # backwards compatibility
  Regressor = Model
end

Version data entries

11 entries across 11 versions & 1 rubygems

Version Path
eps-0.4.1 lib/eps.rb
eps-0.4.0 lib/eps.rb
eps-0.3.9 lib/eps.rb
eps-0.3.8 lib/eps.rb
eps-0.3.7 lib/eps.rb
eps-0.3.6 lib/eps.rb
eps-0.3.5 lib/eps.rb
eps-0.3.4 lib/eps.rb
eps-0.3.3 lib/eps.rb
eps-0.3.2 lib/eps.rb
eps-0.3.1 lib/eps.rb