Trying out Google Prediction API from R

Ubuntu Login
Image via Wikipedia

So I saw the news at NY R Meetup and decided to have a go at Prediction API Package (which first started off as a blog post at

http://onertipaday.blogspot.com/2010/11/r-wrapper-for-google-prediction-api.html

1)My OS was Ubuntu 10.10 Netbook

Ubuntu has a slight glitch plus workaround for installing the RCurl package on which the Google Prediction API is dependent- you need to first install this Ubuntu package for RCurl to install libcurl4-gnutls-dev

Once you install that using Synaptic,

Simply start R

2) Install Packages rjson and Rcurl using install.packages and choosing CRAN

Since GooglePredictionAPI is not yet on CRAN

,

3) Download that package from

https://code.google.com/p/google-prediction-api-r-client/downloads/detail?name=googlepredictionapi_0.1.tar.gz&can=2&q=

You need to copy this downloaded package to your “first library ” folder

When you start R, simply run

.libPaths()[1]

and thats the folder you copy the GooglePredictionAPI package  you downloaded.

5) Now the following line works

  1. Under R prompt,
  2. > install.packages("googlepredictionapi_0.1.tar.gz", repos=NULL, type="source")

6) Uploading data to Google Storage using the GUI (rather than gs util)

Just go to https://sandbox.google.com/storage/

and thats the Google Storage manager

Notes on Training Data-

Use a csv file

The first column is the score column (like 1,0 or prediction score)

There are no headers- so delete headers from data file and move the dependent variable to the first column  (Note I used data from the kaggle contest for R package recommendation at

http://kaggle.com/R?viewtype=data )

6) The good stuff:

Once you type in the basic syntax, the first time it will ask for your Google Credentials (email and password)

It then starts showing you time elapsed for training.

Now you can disconnect and go off (actually I got disconnected by accident before coming back in a say 5 minutes so this is the part where I think this is what happened is why it happened, dont blame me, test it for yourself) –

and when you come back (hopefully before token expires)  you can see status of your request (see below)

> library(rjson)
> library(RCurl)
Loading required package: bitops
> library(googlepredictionapi)
> my.model <- PredictionApiTrain(data="gs://numtraindata/training_data")
The request for training has sent, now trying to check if training is completed
Training on numtraindata/training_data: time:2.09 seconds
Training on numtraindata/training_data: time:7.00 seconds

7)

Note I changed the format from the URL where my data is located- simply go to your Google Storage Manager and right click on the file name for link address  ( https://sandbox.google.com/storage/numtraindata/training_data.csv)

to gs://numtraindata/training_data  (that kind of helps in any syntax error)

8) From the kind of high level instructions at  https://code.google.com/p/google-prediction-api-r-client/, you could also try this on a local file

Usage

## Load googlepredictionapi and dependent libraries
library(rjson)
library(RCurl)
library(googlepredictionapi)

## Make a training call to the Prediction API against data in the Google Storage.
## Replace MYBUCKET and MYDATA with your data.
my.model <- PredictionApiTrain(data="gs://MYBUCKET/MYDATA")

## Alternatively, make a training call against training data stored locally as a CSV file.
## Replace MYPATH and MYFILE with your data.
my.model <- PredictionApiTrain(data="MYPATH/MYFILE.csv")

At the time of writing my data was still getting trained, so I will keep you posted on what happens.

Cisco SocialMiner

A highly simplified version of the RSS feed ic...
Image via Wikipedia

A new product from Cisco to mine social media for analytics on sentiment-

http://www.cisco.com/en/US/products/ps11349/index.html

Cisco SocialMiner is a social media customer care solution that can help you proactively respond to customers and prospects communicating through public social media networks like Twitter, Facebook, or other public forums or blogging sites. By providing social media monitoring, queuing, and workflow to organize customer posts on social media networks and deliver them to your social media customer care team, your company can respond to customers in real time using the same social network they are using.

Cisco SocialMiner provides:

  • The ability to configure multiple campaigns to search for customer postings on the public social web about your company’s products, services, or area of expertise
  • Filtering of social contacts based on preconfigured campaign filters to focus campaign searches
  • Routing of social contacts to skilled customer care representatives in the contact center or to experts in the enterprise–multiple people can work together to handle responses to customer postings through shared work queues
  • Detailed metrics for social media customer care activities, campaign reports, and team reports

With Cisco SocialMiner, your company can listen and respond to customer conversations originating in the social web. Being proactive can help your company enhance its service, improve customer loyalty, garner new customers, and protect your brand.

Table 1. Features and Benefits of Cisco SocialMiner 8.5

Feature Benefits
Product Baseline Features
Social media feeds

• Feeds are configurable sources to capture public social contacts that contain specific words, terms, or phrases.

• Feeds enable you to search for information on the public social web about your company’s products, services, or area of expertise.

• Cisco SocialMiner supports the following types of feeds:

• Facebook

• Twitter
Campaign management

• Groups feeds into campaigns to organize all posting activity related to a product category or business objective

• Produces metrics on campaign activity

• Provides the ability to configure multiple campaigns to search for customer postings on specific products or services

• Groups social contacts for handling by the social media customer care team

• Enables filtering of social contacts based on preconfigured campaign filters to focus campaign searches
Route and queue social contacts

• Enables routing of social contacts to skilled customer care representatives in the contact center

• Draws on expertise in the enterprise by allowing multiple people in the enterprise to work together to handle responses to customer postings through shared work queues

• Enables automated distribution of work to improve efficiency and effectiveness of social media engagement
Tagging

• Allows work to be routed to the appropriate team by grouping each post or social contact into different categories; for example, a post can be marked with the “customer_support” tag; this post will then appear on a customer support agent’s queue for processing
Social media customer care metrics

• Provides detailed metrics on social media customer care activities, campaign reports, and team reports

• Measures work and results

• Manages to service-level goals

• Supports brand management

• Optimizes staffing

• Includes dashboarding of social media posting activity when Cisco Unified Intelligence Center is used
Reporting for social contacts

• Provides a reporting database that can be accessed using any reporting tool, including Cisco Unified Intelligence Center

• Enables customer care management to accurately report on and track social media interactions by the contact center
OpenSocial-compliant gadgets

Representational State Transfer (REST) application programming interfaces (APIs)

• Provides flexible user interface options

• Enables extensive opportunities for customization
Optional integration with full suite of Cisco Collaboration tools

• Allows you to take advantage of the full suite of Cisco Collaboration tools, including Cisco Quad, Cisco Show and Share, and Cisco Pulse technology, to help your social media customer care team quickly find answers to help customers efficiently and effectively

• Easy to maintain with existing IT personnel
Operating Environment
Cisco Unified Computing System(UCS) C-Series or B-Series Servers

• Requires a Cisco UCS C-Series or B-Series Server.

• Server consolidation means lower cost per server with Cisco UCS Servers.
Architecture
Scalability

• One server supports up to 30 simultaneous social media customer care users and 10,000 social contacts per hour.
Management
Cisco Unified Real-Time Monitoring Tool (RTMT)

• Operational management is enhanced through integration with the Cisco Unified RTMT, providing consistent application monitoring across Cisco Unified Communications Solutions.
Simple Network Management Protocol (SNMP)

• SNMP with an associated MIB is supported through the Cisco Voice Operating System (VOS).
Reporting
Cisco Unified Intelligence Center

• Create customizable reports of social media customer care events using Cisco Unified Intelligence Center (purchased separately).

 

 

Google: Prediction API and other cool stuff

Google just announced it’s tools Big Query and Prediction API for use with it’s new cloud storage device called Google Storage. With this the computing cycle seems to have come a full circle – from mainframe to desktop/servers to cloud. The Prediction API seems interesting but it, and the other services, are quite clearly dependent on market as well as developer enthusiasm. Me thinks, Google knows a thing or two about Big Data, and this one looks like a revenue positive product from Google ( unless they get REST less and let it languish like other great ideas-like Docs,Wave etc)

Also could be interesting is applications from both R, as well as SAS and SPSS to start using this remote data cloud/server farm 😉

With Storage,Querying and Prediction Analysis- Google is definitely in the Infrastructure as a Service business, but success with these services would be crucial to establish it’s name in the formidably lucrative business analytics and business intelligence fields.

http://code.google.com/apis/predict/

http://code.google.com/apis/bigquery/

http://code.google.com/apis/storage/