Sha256: dad4fdf36dfce9d223583c426f753c56cfd03c34a02bf07e682541b097248334

Contents?: true

Size: 1.35 KB

Versions: 1

Compression:

Stored size: 1.35 KB

Contents

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

# stdlib
require "json"

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

# pmml
require_relative "eps/pmml"
require_relative "eps/pmml/generator"
require_relative "eps/pmml/loader"

# evaluators
require_relative "eps/evaluators/linear_regression"
require_relative "eps/evaluators/lightgbm"
require_relative "eps/evaluators/naive_bayes"
require_relative "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

1 entries across 1 versions & 1 rubygems

Version Path
eps-0.5.0 lib/eps.rb