Getting Started with YottamineR® on Windows

1  Quick Start

Go through section #2 to #4 to install the YottamineR® client.

Note: This guide has been tested with Windows 7 x64 (64-bit) systems and may need some adjustments if you are using other Operating Systems or x86 (32-bit) systems. In that case, please contact us for help.

2  Prerequisites and Environment Requirements

Sign up for a user account at Yottamine Predictive Web Service WebSite (YPS).

If you haven’t signed up for a trial account at YPS, please contact us to obtain offer code to sign-up.

This is required to obtain API credentials to use the YottamineR® client.

Install the following to run the YottamineR® client.

3  Install YottamineR® and support packages

Download the YottamineR® client distribution for Windows. You can obtain it after you register for your YPS account.

Download it when you login to YPS account.

Select one of the following install location options.

3.1  Default Install Location Setup

The YottamineR® client distribution is a compressed zip format. To extract it, you can use Windows Explorer to open the archive and copy “yps-client” folder to “C:\” or extract the archive to “C:\” using any of your favorite archive programs.

After extracting it, you should see a “C:\yps-client” folder in your Windows Explorer.

3.2  Custom Install Location Setup

The YottamineR® client distribution default install location is in “C:\”. If you extract the setup files to the default location, all the source and destination path to install the R packages will be correct and you can skip these steps below.

  1. Set source path to where you extracted the file.

For example, if you extracted file to “c:”

source path = c:\yps-client\R\packages

  1. Make destination install location folders.

(This step required only if you are changing the default destination install path “c:\yps-client\R\data”.)

For example, if you want to install the packages to c:\yps-client\R\data

dest path = c:\yps-client\R\data

Select one of the following package installation options.

3.3  Installing packages in R Console Session

  1. Run R Studio or R Console
  2. Copy these lines into the console and execute. This will install the YottamineR® and it’s support packages into R.

Note: If you choose Custom Setup above, you have to update the source and destination paths.

install.packages(repos=NULL, pkgs=c("C://yps-client//R//packages//rJava_0.9-4.zip"), lib="c://yps-client//R//data");

install.packages(repos=NULL, pkgs=c("C://yps-client//R//packages//YottamineR_2.2-6.zip"), lib="c://yps-client//R//data");

install.packages(repos=NULL, pkgs=c("C://yps-client//R//packages//e1071_1.6-1.zip"), lib="c://yps-client//R//data");

install.packages(repos=NULL, pkgs=c("C://yps-client//R//packages//SparseM_1.03.zip"), lib="c://yps-client//R//data");

install.packages(repos=NULL, pkgs=c("C://yps-client//R//packages//lattice_0.20-23.zip"), lib="c://yps-client//R//data");

install.packages(repos=NULL, pkgs=c("C://yps-client//R//packages//matlab_0.8.9.zip"), lib="c://yps-client//R//data");

Update: With R 3.0.2, you might get warnings saying that package is not available (for R version 3.0.2). Please ignore it if the package was installed successfully on the next line.

When you are done, you should see that R has installed all the packages.

3.4  Installing packages in R Studio using the Package Installer

Note: The latest YottamineR®package is 2.2-6. Aside from that, all the steps are identical.

If you prefer to install R packages using the package installer, please do the following:

1.  Open Rstudio

2.  Goto “Tools” -> “Install Packages…”

(Click on “Yes” if RStudio ask you if you like to create a personal library.)

3.  Click on “Browse” and select “YottamineR_1.0-1.zip” or the latest version from c:\yps-client\R\packages.

Note: If you choose Custom Setup above, your installation location of yps-client may be different.

4.  Click on “Install” and the package will be installed. You will see a confirmation from the R console saying that package has been installed.

Update: With R 3.0.2, you might get warnings saying that package is not available (for R version 3.0.2). Please ignore it if the package was installed successfully on the next line.

You can also confirm correct installation from the Packages tab. You should see the YottamineR® package installed in the list.

Repeat steps 2 to 4 to install the following packages from “c:\yps-client\R\packages” location.

Note: If you choose Custom Setup above, your installation location of yps-client may be different.

Determine which package you want to install. The core packages are required and the YottamineR® client will not work without rJava package installed. The rest are optional depending on what features you want to use.

core packages (required)

YottamineR_2.0-0.zip

rJava_0.9-3.zip

Plotting support (optional)

e1071_1.6-1.zip

SparseM_0.96.zip

Sparse Matrix support (optional)

lattice_0.20-10.zip

matlab_0.8.9.zip

4  Post Setup

Now let’s test your installation.

Select one of the following options.

4.1  Post Setup check with the installed packages in R Console Session

Open up RStudio or R Console to open a new session and copy these lines into your session.

#Load YottamineR(R) and rJava package into R

library("rJava", lib.loc="C:\\yps-client\\R\\data")

library("YottamineR", lib.loc="C:\\yps-client\\R\\data")

#If everything is correct, you should not get any errors.

#To see the YottamineR(R) functions help index:

help(package="YottamineR");

#The main YottamineR(R) help info should show up.

4.2  Post Setup check with the installed packages in R Studio using the Package Installer

Open up RStudio and load the YottamineR® package into R. You should see that the package has successfully loaded.

Click on the “YottamineR” in the installed Packages list. The YottamineR® help window should show up.

If you get no errors using one of the post setup options to check your installation, congratulations – you have successfully installed YottamineR® into your environment!

5  Documentation and Samples

In RStudio or R Console session, you can open the R scripts in the YottamineR\doc\samples folder.

The samples are located in the YottamineR® installed package area. By default it’s installed in:

C:\yps-client\R\data\YottamineR\doc\samples

To open the sample script files, you can use RStudio to goto File -> Open File …

Then navigate to the sample folder and click to open.

Script Name / Description / Availability
build-model-from-RData / Build model from RData – Read in either dense or sparse adult sample set into R matrix and generate training data and build model / All Accounts
build-model-from-import-exisitng-file-to-s3 / Build model from importing existing file from s3 to Yottamine s3 or my s3 bucket / Registered Accounts
build-model-from-upload-local-to-s3 / Build model from upload local file to Yottamine s3 or my s3 bucket / Registered Accounts
run-predictions / Running prediction using existing model file from Yottamine s3 or my s3 bucket / All Accounts
plot-local-model-result / Plot existing local model results using modelId / All Accounts
stop-building-model / Stop building running or pending model jobs using modelId / All Accounts
storage-examples / Contains all R functions to do upload, import from s3, export, and file operations. Note that import from s3 and export functions are not available for trial accounts. / Various

You will have to edit the following:

# Enter your API credentials from your account.

apiKey <- "<API Key>"

apiPassword <- "<Password>"

setAPIClientSettings(apiKey, apiPassword);

https://yps.yottamine.com/user/home.html

From your home page, click on API SETTINGS button to get here.

Replace <API Key> and <Password> with the API credentials information from this API settings page.

If you installed YottamineR® in “c:\yps-client” by default, that’s all the changes you need to make to run these samples since the training data path will be correct.

To run these samples, open them up with RStudio or R Console and update them with your API credentials.

To execute, select all of the script and use RStudio Run button or paste script in the session and press “Enter” to run.

For detailed Model Building Project Parameters documentation, you can find it in:

C:\yps-client\R\data\YottamineR\doc\Model Building Project Parameters.pdf

This pdf doc also contains project parameter settings for different type of SVM algorithms and test methods.

6  Troubleshooting

Symptom / Possible Cause / Solution
R reports that none of the methods exist in YottamineR® / The YottamineR® package is not loaded in R or R environment not setup correctly. / Repeat “Post Setup” to make sure your installation is correct.
YottamineR® reports that authentication failed / Your API credential is not correct. / Repeat “Documentation and Samples” to make sure your script has been updated to work with your API account.

7  Appendices

7.1  Removing packages

You can easily remove an installed package either from R Console or Windows command. This is sometimes necessary when you want to update YottamineR® or support packages.

7.2  Removing packages from R Console

Copy these lines into the console session and execute.

remove.packages("rJava", lib="c://yps-client//R//data");

remove.packages("YottamineR", lib="c://yps-client//R//data");

remove.packages("e1071", lib="c://yps-client//R//data");

remove.packages("SparseM", lib="c://yps-client//R//data");

remove.packages("lattice", lib="c://yps-client//R//data");

remove.packages("matlab", lib="c://yps-client//R//data");

7.3  Removing packages from R Studio

If you installed YottamineR® using the package installer, you can remove it by just clicking the (X) to the right of the installed package list.

7.4  Advanced Setup - Using R in Windows Command Box

To use R in a Windows Command box, you have to first update the System path in your Windows environment so it can find the R program. Here are the steps on how to do that.

  1. Update the System “Path” variable
  1. From Start Menu, right click on “Computer” and left click on “Properties”
  1. Click on “Advanced system settings” and then on “Environment Variables”
  1. Click on “Path” under System variables and then click on “Edit”
  1. Append ";C:\Program Files\R\R-2.15.2\bin\x64\" to your System Path

Note: You may have to change the path depending on where you installed it.

Click “Okay” when done

7.5  Installing packages from Windows Command Box

  1. To install a package, run this command in CMD prompt.
  1. R CMD INSTALL <source path> -l <dest path> (where source and dest paths were set above)

For example, to install rJava using the paths above:

R CMD INSTALL c:\yps-client\R\packages\rJava_0.9-4.zip -l c:\\yps-client\\R\\data

Repeat the same for all other packages you desire.

R CMD INSTALL c:\yps-client\R\packages\YottamineR_2.2-6.zip -l c:\\yps-client\\R\\data

R CMD INSTALL c:\yps-client\R\packages\lattice_0.20-23.zip -l c:\\yps-client\\R\\data

R CMD INSTALL c:\yps-client\R\packages\matlab_0.8.9.zip -l c:\\yps-client\\R\\data

R CMD INSTALL c:\yps-client\R\packages\e1071_1.6-1.zip -l c:\\yps-client\\R\\data

R CMD INSTALL c:\yps-client\R\packages\SparseM_1.03.zip -l c:\\yps-client\\R\\data

7.6  Removing packages from Windows Command Box

R CMD REMOVE <package name> -l <dest_path

For example, to remove rJava: R CMD REMOVE rJava -l c:\\yps-client\\R\\data

Copyright © 2013, Yottamine Analytics / 1