<jupyter_start><jupyter_text>Preface Welcome! Allow me to be the first to offer my congratulations on your decision to take an interest in Applied Predictive Modeling with Python! This is a collection of IPython Notebooks that provides an interactive way to reproduce this awesome [book](http://www.amazon.com/Applied-Predictive-Modeling-Max-Kuhn/dp/1461468485) by Kuhn and Johnson. If you experience any problems along the way or have any feedback at all, please reach out to me.Best Regards, <NAME> Email: <EMAIL> Twitter: @_LeiG  Setups<jupyter_code>import numpy
import scipy
import pandas
import sklearn
import matplotlib
import rpy2
import pyearth
import statsmodels<jupyter_output><empty_output><jupyter_text>Prepare Datasets Thanks to the authors, all datasets that are necessary in order to reproduce the examples in the book are available in the *.RData* format from their R package $\texttt{caret}$ and $\texttt{AppliedPredictiveModeling}$. To prepare them for our purpose, I did a little hack so that you can download all the datasets and convert them from *.RData* to *.csv* by running this script "[fetch_data.py](https://github.com/LeiG/Applied-Predictive-Modeling-with-Python/blob/master/fetch_data.py)".<jupyter_code>%run ../fetch_data.py<jupyter_output>Using existing datasets folder:/Users/leigong/Documents/Research/DataScience/Applied-Predictive-Modeling/datasets
Downloading AppliedPredictiveModeling from http://cran.r-project.org/src/contrib/AppliedPredictiveModeling_1.1-6.tar.gz (2 MB)
Decomposing /Users/leigong/Documents/Research/DataScience/Applied-Predictive-Modeling/datasets/AppliedPredictiveModeling_1.1-6.tar.gz
Checking that the AppliedPredictiveModeling file exists...
=> Success!
Downloading Caret from http://cran.r-project.org/src/contrib/caret_6.0-37.tar.gz (2 MB)
Decomposing /Users/leigong/Documents/Research/DataScience/Applied-Predictive-Modeling/datasets/caret_6.0-37.tar.gz
Checking that the Caret file exists...
=> Success!
Extract .RData files from the package...
Convert .RData to .csv and clean up .RData files...
=> Success!
{'fraction_non_alphanumeric': 0.09016393442622951, 'fraction_numerical': 0.013018322082931534, 'mean_word_length': 5.504702194357367, 'pattern_counts': {'":': 0, '<': 10, '<?xml version=': 0, '>': 13, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '2', 'dir': 'jupyter-structured-clean-dedup', 'id': '501643', 'license': 'MIT', 'n_tokens_mistral': 665, 'n_tokens_neox': 626, 'n_words': 200, 'path': 'notebooks/.ipynb_checkpoints/Chapter 1-checkpoint.ipynb', 'repo_name': 'aremirata/IntroductionToMachineLearningAndPredictiveAnalytics', 'size': '2089'}