<p><div><div><div><div data-show-faces="false" data-height="21" data-width="100" data-layout="button_count" data-send="true" data-href="https://www.r-bloggers.com/big-data-analytics-with-revoscaler-exercises-2/"></div></div><div></div></div><div></div></div>
<div>
(This article was first published on <strong><a href="http://www.r-exercises.com/2017/09/11/big-data-analytics-with-revoscaler-exercises-2/"> R-exercises</a></strong>, and kindly contributed to <a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers)</a> </div>
<p><a rel="nofollow" href="https://i2.wp.com/www.r-exercises.com/wp-content/uploads/2017/08/download.jpg" target="_blank"><img alt="" src="https://i2.wp.com/www.r-exercises.com/wp-content/uploads/2017/08/download.jpg?resize=300%2C168" class="wp-image-3037" data-recalc-dims="1"></a><br>
In the last set of <a rel="nofollow" href="http://www.r-exercises.com/2017/08/24/big-data-analytics-with-revoscaler-exercises/" target="_blank">exercises </a> , you have seen the basic functionalities of RevoScaleR .In this exercise set we will explore RevoScaleR further.<br>
get the Credit card fraud data set from <a rel="nofollow" href="https://packages.revolutionanalytics.com/datasets/" target="_blank">revolutionanalytics</a> and lets get started<br>
Answers to the exercises are available <a rel="nofollow" href="http://www.r-exercises.com/2017/09/11/big-data-analytics-with-revoscaler-exercises-2-solutions/" target="_blank">here</a>.Please check the documentation before starting these exercise set </p>
<p>If you obtained a different (correct) answer than those listed on the solutions page, please feel free to post your answer as a comment on that page.</p>
<p><strong>Exercise 1</strong><br>
RevoScaleR provides option to convert a dataframe into a xdf file,which you might need while storing temporary data frame that you create during analysis work .<br>
Now Create an XDF file from airquality dataset </p>
<p><strong>Exercise 2</strong><br>
In the previous set of exercise you have seen rxHistogram briefly,Now we will see how to get meaningful information from large dataset with a visualization .<br>
create a scatterplot from the xdf file for Balance vs numTrans where numTrans is greater than 50 and have more than 50 creditline and the fraudrisk is 1 .</p>
<p><strong>Exercise 3</strong><br>
Good thing about RevoScaleR is that it comes with a sample data directory,find the sample data directory by rxGetoptions<br>
and use claims.text and convert it into xdf file .You have already used rxImport ,which can be used but for plain text data there is an highly optimized method in RevoscaleR.Please use that</p>
<p><strong>Exercise 4</strong><br>
if you check the sampledatadir you can see that there are 10 csv files like moredefaulsmall2000.csv etc . rxImport can create a single xdf by joining them row wise .<br>
Please create a new xdf which will contain all the data from moredefaultsmall2000.csv to moredefaultsmall2010.csv.<br>
You can write a loop or do it in a functional way , if you have followed my exercises on functional programming (<a rel="nofollow" href="http://www.r-exercises.com/2017/05/19/a-primer-in-functional-programming-in-r/" target="_blank">1</a> &amp; <a rel="nofollow" href="http://www.r-exercises.com/2017/06/01/a-primer-in-functional-programming-in-r-part-2/" target="_blank">2</a>) , I hope you know how to achieve this without loop . </p>
<p><strong>Exercise 5</strong><br>
We will see how rxDataStep can create new variables with complex calculations. on the creditcard fraud xdf create a column domTrans which is numTrans -numIntlTrans and create another<br>
column balance per domTran which is Balance/domTrans. This exercise will show you how we can use temp variables to create more complex new columns from existing columns </p>
<p><strong>Exercise 6</strong><br>
in rxDataStep an important feature is transform functions . One thing to remember that when you use a transform function ,the transform function sees a chunk of data at a time , so if you require any value for the whole dataset ,you need to create it before the transformfunction ,not within the transform function .<br>
Now create the z score of balance in the credit card fraud xdf file,which you have already created in the first set of exercise. </p>
<p>The next 3 exercise will give you a basic idea on how to split xdf into training /test set , we will see a bit deeper into rxLinMod as well.Please remember that the goal<br>
of this exercise is not to predict but to make you aware of few important details of modelling by revoscaleR</p>
<p><strong>Exercise 7</strong><br>
split the credit card fraud xdf into two random parts with 25 percent being the test data and 75 percent is the training data.<br>
Hint -You need to use splitByFactor and create it using transforms .Use a Seed to make this reproducible </p>
<div>
<aside><img src="http://www.r-exercises.com/2017/09/11/big-data-analytics-with-revoscaler-exercises-2/"></aside>
<div><strong>Learn more</strong> about importing big data in the online course <a rel="nofollow" href="http://www.r-exercises.com/product/data-mining-with-r-go-from-beginner-to-advanced/" target="_blank">Data Mining with R: Go from Beginner to Advanced</a>. In this course you will learn how to
<ul>
<li>work with different data import techniques,</li>
<li>know how to import data and transform it for a specific moddeling or analysis goal,</li>
<li>and much more.</li>
</ul>
</div>
</div>
<p><strong>Exercise 8</strong><br>
In the last set you used rxLinMod ,use the same expression but use cube =true as a parameter . You may need to tweak around to make it work , as the first expression should be categorical when using cube . Can you see the difference between both models . </p>
<p><strong>Exercise 9</strong><br>
How do you define a linear regression where you want to analyze whether fraudrisk depends only on the interaction of gender and balance and how do you define if you want to check fraudrisk’s dependency on the interaction as well as their individual contribution . </p>
<p><strong>Exercise 10</strong><br>
You might want to check fraudrisk for a different segment of balance . Create 5 different segments of 0-10k,10k-20k and so on and check the Linear Regression result . </p>
<div>
<h3>Related exercise sets:</h3>
<ol>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/08/24/big-data-analytics-with-revoscaler-exercises/" title="Big Data analytics with RevoScaleR Exercises" target="_blank">Big Data analytics with RevoScaleR Exercises </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/06/09/big-data-manipulation-in-r-exercises/" title="Big Data Manipulation in R Exercises" target="_blank">Big Data Manipulation in R Exercises </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/2017/06/10/density-based-clustering-exercises/" title="Density-Based Clustering Exercises" target="_blank">Density-Based Clustering Exercises </a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/start-here-to-learn-r/" target="_blank">Explore all our (>1000) R exercises</a></li>
<li><a rel="nofollow" href="http://www.r-exercises.com/r-courses/" target="_blank">Find an R course using our R Course Finder</a> directory</li>
</ol>
</div>
	<p>
<div>
<div>To <strong>leave a comment</strong> for the author, please follow the link and comment on their blog: <strong><a href="http://www.r-exercises.com/2017/09/11/big-data-analytics-with-revoscaler-exercises-2/"> R-exercises</a></strong>.</div>
<hr>
<a rel="nofollow" href="https://www.r-bloggers.com/">R-bloggers.com</a> offers <strong><a rel="nofollow" href="https://feedburner.google.com/fb/a/mailverify?uri=RBloggers">daily e-mail updates</a></strong> about <a rel="nofollow" href="https://www.r-project.org/" title="The R Project for Statistical Computing">R</a> news and <a rel="nofollow" href="https://www.r-bloggers.com/search/tutorial" title="R tutorials">tutorials</a> on topics such as: <a rel="nofollow" href="https://www.r-bloggers.com/search/data%20science" title="Data science">Data science</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Big%20Data" title="Big Data">Big Data, <a rel="nofollow" href="https://www.r-users.com/" title="R jobs">R jobs</a>, visualization (<a rel="nofollow" href="https://www.r-bloggers.com/search/ggplot2" title="ggplot and ggplot2 tutorials">ggplot2</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/boxplot" title="Boxplots using lattice and ggplot2 tutorials">Boxplots</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/map" title="Maps and gis">maps</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/animation" title="Animation in R">animation</a>), programming (<a rel="nofollow" href="https://www.r-bloggers.com/search/RStudio" title="RStudio IDE for R">RStudio</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/sweave" title="Sweave and literate programming">Sweave</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/LaTeX" title="LaTeX in R">LaTeX</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/SQL" title="SQL and databases">SQL</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/eclipse" title="Eclipse IDE for R">Eclipse</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/git" title="git and github, Version Control System">git</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/hadoop" title="Large data in R using Hadoop">hadoop</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/Web+Scraping" title="Web Scraping of google, facebook, yahoo, twitter and more using R">Web Scraping</a>) statistics (<a rel="nofollow" href="https://www.r-bloggers.com/search/regression" title="Regressions and ANOVA analysis tutorials">regression</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/PCA" title="principal component analysis tutorial">PCA</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/time+series" title="Time series">time series</a>, <a rel="nofollow" href="https://www.r-bloggers.com/search/trading" title="finance trading">trading</a>) and more...
<img width="1" alt="" src="http://feeds.feedburner.com/~r/RBloggers/~4/sBD95bfVfyU" height="1"></a></div>