ankane / eps

Machine learning for Ruby
MIT License
643 stars 15 forks source link

ArgumentError: comparison of String with 1.0000000180025095e-35 failed #22

Closed creativetags closed 3 years ago

creativetags commented 3 years ago

I'm seeing a weird issue trying out your example code with some of my data.

class MarkModel < Eps::Base
  def build
    data = [{:title=>"Full Stack Developer Needed for property rental management website", :category=>"Full Stack Development", :mark=>true}, {:title=>"UI/UX design - Upwork", :category=>"UX/UI Design", :mark=>false}]

    model = Eps::Model.new(data, target: :mark)
    puts model.summary
  end

  private

  def features(p)
    {
      title: p.title.to_s,
      category: p.category.to_s,
      mark: p.mark
    }
  end

end

With this data I get:

ArgumentError: comparison of String with 1.0000000180025095e-35 failed
from .../eps-0.3.7/lib/eps/evaluators/lightgbm.rb:95:in `>'

but change the 2nd title to :title=>"UI/UX design" and it works fine. Certain combinations of words work and others don't.

ankane commented 3 years ago

Hey @creativetags, thanks for reporting! Should be fixed on master (text features were throwing off the index of categorical features).