Giter Site home page Giter Site logo

r4wml's Introduction

R4WML

R library for Watson Machine Learning (WML).

Installation and use

devtools::install_github(repo = 'IBMDataScience/R4WML')
library(R4WML)

WatsonML (WML) account information (these are found in your Watson ML service in BlueMix)

watson_ml_creds_url      <- 'https://ibm-watson-ml.mybluemix.net'
watson_ml_creds_username <- '9999e4bc-3c8c-4b56-bade-25a0deadbeef'
watson_ml_creds_password <- '8888ecf8-18f9-4ae4-bead-e5d53deadbabe'

Define deployed WML endpoints

# Deployed WML endpoints
ml_endpoint.naive_bayes         <- 'https://ibm-watson-ml.mybluemix.net/v3/wml_instances/5a239919-4deb-4aa2-b02e-4374beefdead/published_models/b7415c48-d4ea-4053-a457-4374beefdead/deployments/c2e94d8f-8004-4cb9-879c-4374beefdead/online'
ml_endpoint.logistic_regression <- 'https://ibm-watson-ml.mybluemix.net/v3/wml_instances/5a239919-4deb-4aa2-b02e-4374beefdead/published_models/ad78deec-3e7f-4f78-96d3-4374beefdead/deployments/d4dd1c64-c763-411f-9c91-4374beefdead/online'

Get WML authentication headers

watson_ml_creds_auth_headers <- get_wml_auth_headers(watson_ml_creds_url, watson_ml_creds_username, watson_ml_creds_password)

Score the data using WML endpoints

data <- read.csv(file='myrecords.csv')

top_100 <- head(data, n=100)
payload <- to_wml_payload(top_100)
results <- wml_score(ml_endpoint.naive_bayes, watson_ml_creds_auth_headers, payload)
payload_scored <- from_wml_payload(results)

View(payload_scored)

For more details, check out this blog.

r4wml's People

Contributors

davin-ibm avatar gfilla avatar

Stargazers

Rafi Kurlansik avatar Adam Massachi avatar

Watchers

Akhil Tandon avatar James Cloos avatar ARG avatar Dejan Glozic avatar Atsushi Tsuchiya avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.