All Projects → apache → Attic Predictionio Sdk Ruby

apache / Attic Predictionio Sdk Ruby

Licence: apache-2.0
PredictionIO Ruby SDK

Programming Languages

ruby
36898 projects - #4 most used programming language
scala
5932 projects

Labels

Projects that are alternatives of or similar to Attic Predictionio Sdk Ruby

Hydrograph
A visual ETL development and debugging tool for big data
Stars: ✭ 144 (-25%)
Mutual labels:  big-data
Presto
The official home of the Presto distributed SQL query engine for big data
Stars: ✭ 12,957 (+6648.44%)
Mutual labels:  big-data
Dvid
Distributed, Versioned, Image-oriented Dataservice
Stars: ✭ 174 (-9.37%)
Mutual labels:  big-data
Parquetviewer
Simple windows desktop application for viewing & querying Apache Parquet files
Stars: ✭ 145 (-24.48%)
Mutual labels:  big-data
Spark.jl
Julia binding for Apache Spark
Stars: ✭ 153 (-20.31%)
Mutual labels:  big-data
Keyvi
Keyvi - the key value index. It is an in-memory FST-based data structure highly optimized for size and lookup performance.
Stars: ✭ 161 (-16.15%)
Mutual labels:  big-data
Storm Doc Zh
Apache Storm 官方文档中文版
Stars: ✭ 142 (-26.04%)
Mutual labels:  big-data
Presto Go Client
A Presto client for the Go programming language.
Stars: ✭ 183 (-4.69%)
Mutual labels:  big-data
Geni
A Clojure dataframe library that runs on Spark
Stars: ✭ 152 (-20.83%)
Mutual labels:  big-data
Keyvi
Keyvi - a key value index that powers Cliqz search engine. It is an in-memory FST-based data structure highly optimized for size and lookup performance.
Stars: ✭ 171 (-10.94%)
Mutual labels:  big-data
Spark With Python
Fundamentals of Spark with Python (using PySpark), code examples
Stars: ✭ 150 (-21.87%)
Mutual labels:  big-data
Datasciencevm
Tools and Docs on the Azure Data Science Virtual Machine (http://aka.ms/dsvm)
Stars: ✭ 153 (-20.31%)
Mutual labels:  big-data
Geopyspark
GeoTrellis for PySpark
Stars: ✭ 167 (-13.02%)
Mutual labels:  big-data
100daysofmlcode
My journey to learn and grow in the domain of Machine Learning and Artificial Intelligence by performing the #100DaysofMLCode Challenge.
Stars: ✭ 146 (-23.96%)
Mutual labels:  big-data
Bigdata Playground
A complete example of a big data application using : Kubernetes (kops/aws), Apache Spark SQL/Streaming/MLib, Apache Flink, Scala, Python, Apache Kafka, Apache Hbase, Apache Parquet, Apache Avro, Apache Storm, Twitter Api, MongoDB, NodeJS, Angular, GraphQL
Stars: ✭ 177 (-7.81%)
Mutual labels:  big-data
Metamodel
Mirror of Apache Metamodel
Stars: ✭ 143 (-25.52%)
Mutual labels:  big-data
Fluo
Apache Fluo
Stars: ✭ 159 (-17.19%)
Mutual labels:  big-data
Gun
An open source cybersecurity protocol for syncing decentralized graph data.
Stars: ✭ 15,172 (+7802.08%)
Mutual labels:  big-data
Flume
Mirror of Apache Flume
Stars: ✭ 2,200 (+1045.83%)
Mutual labels:  big-data
Attic Predictionio
PredictionIO, a machine learning server for developers and ML engineers.
Stars: ✭ 12,522 (+6421.88%)
Mutual labels:  big-data

Apache PredictionIO Ruby SDK

Build Status Gem Version

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:

gem install predictionio

Or using Bundler with:

gem 'predictionio', '0.12.1'

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

require 'predictionio'

# Define environment variables.
ENV['PIO_THREADS'] = '50' # For async requests.
ENV['PIO_EVENT_SERVER_URL'] = 'http://localhost:7070'
ENV['PIO_ACCESS_KEY'] = 'YOUR_ACCESS_KEY' # Find your access key with: `$ pio app list`.

# Create PredictionIO event client.
client = PredictionIO::EventClient.new(ENV['PIO_ACCESS_KEY'], ENV['PIO_EVENT_SERVER_URL'], Integer(ENV['PIO_THREADS']))

Create a $set user event and send it to Event Server

client.create_event(
  '$set',
  'user',
  user_id
)

Create a $set item event and send it to Event Server

client.create_event(
  '$set',
  'item',
  item_id,
  { 'properties' => { 'categories' => ['Category 1', 'Category 2'] } }
)

Create a $set item event and send it to Event Server to specific channel

NOTE: channels are supported in PIO version >= 0.9.2 only. Channel must be created first.

client.create_event(
  '$set',
  'item',
  item_id,
  { 'properties' => { 'categories' => ['Category 1', 'Category 2'], 'channel' => 'test-channel'} }
)

Create a user 'rate' item event and send it to Event Server

client.create_event(
  'rate',
  'user',
  user_id, {
    'targetEntityType' => 'item',
    'targetEntityId' => item_id,
    'properties' => { 'rating' => 10 }
  }
)

Asynchronous request

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.

Query PredictionIO Engine

Connect to the Engine:

# Define environmental variables.
ENV['PIO_ENGINE_URL'] = 'http://localhost:8000'

# Create PredictionIO engine client.
client = PredictionIO::EngineClient.new(ENV['PIO_ENGINE_URL'])

Send a prediction query to the engine and get the predicted result:

# Get 5 recommendations for items similar to 10, 20, 30.
response = client.send_query(items: [10, 20, 30], num: 5)

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 SDK component.

Contributing

Please follow these instructions.

License

Apache License 2.0.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].