Machine learning for Ruby
- Build predictive models quickly and easily
- Serve models built in Ruby, Python, R, and more
Check out this post for more info on machine learning with Rails
Add this line to your application’s Gemfile:
gem "eps"On Mac, also install OpenMP:
brew install libompCreate a model
data = [
{bedrooms: 1, bathrooms: 1, price: 100000},
{bedrooms: 2, bathrooms: 1, price: 125000},
{bedrooms: 2, bathrooms: 2, price: 135000},
{bedrooms: 3, bathrooms: 2, price: 162000}
]
model = Eps::Model.new(data, target: :price)
puts model.summaryMake a prediction
model.predict(bedrooms: 2, bathrooms: 1)Store the model
File.write("model.pmml", model.to_pmml)Load the model
pmml = File.read("model.pmml")
model = Eps::