lib/eps/evaluators/linear_regression.rb in eps-0.3.3 vs lib/eps/evaluators/linear_regression.rb in eps-0.3.4

- old
+ new

@@ -7,10 +7,12 @@ @coefficients = Hash[coefficients.map { |k, v| [k.is_a?(Array) ? [k[0].to_s, k[1]] : k.to_s, v] }] @features = features @text_features = text_features || {} end - def predict(x) + def predict(x, probabilities: false) + raise "Probabilities not supported" if probabilities + intercept = @coefficients["_intercept"] || 0.0 scores = [intercept] * x.size @features.each do |k, type| raise "Missing data in #{k}" if !x.columns[k] || x.columns[k].any?(&:nil?)