The Ruby SDK provides a convenient wrapper for PredictionIO Event Server API and
Engine API. It allows you to quickly record your users’ behavior and retrieve
personalized predictions for them.
Please see the PredictionIO App Integration
Overview to
understand how the SDK can be used to integrate PredictionIO Event Server and
Engine with your application.
Installation
Ruby 2+ required!
The module is published to RubyGems and
can be installed directly by:
To send an async request, simply use the acreate_event method instead of
create_event. Be aware that the asynchronous method does not throw errors.
It’s best to use the synchronous method when first getting started.
Apache PredictionIO Ruby SDK
The Ruby SDK provides a convenient wrapper for PredictionIO Event Server API and Engine API. It allows you to quickly record your users’ behavior and retrieve personalized predictions for them.
Documentation
Full Ruby SDK documentation can be found here.
Please see the PredictionIO App Integration Overview to understand how the SDK can be used to integrate PredictionIO Event Server and Engine with your application.
Installation
Ruby 2+ required!
The module is published to RubyGems and can be installed directly by:
Or using Bundler with:
Sending Events to Event Server
Please refer to Event Server documentation for event format and how the data can be collected from your app.
Instantiate Event Client and connect to PredictionIO Event Server
Create a
$setuser event and send it to Event ServerCreate a
$setitem event and send it to Event ServerCreate a
$setitem event and send it to Event Server to specific channelNOTE: channels are supported in PIO version >= 0.9.2 only. Channel must be created first.
Create a user ‘rate’ item event and send it to Event Server
Asynchronous request
To send an async request, simply use the
acreate_eventmethod instead ofcreate_event. Be aware that the asynchronous method does not throw errors. It’s best to use the synchronous method when first getting started.Query PredictionIO Engine
Connect to the Engine:
Send a prediction query to the engine and get the predicted result:
Mailing List
Please use the Apache mailing lists. Subscription instructions are here.
Issue Tracker
Use the Apache JIRA, and file any issues under the
Ruby SDKcomponent.Contributing
Please follow these instructions.
License
Apache License 2.0.