Book Image

Machine Learning with R Quick Start Guide

By : Iván Pastor Sanz
Book Image

Machine Learning with R Quick Start Guide

By: Iván Pastor Sanz

Overview of this book

Machine Learning with R Quick Start Guide takes you on a data-driven journey that starts with the very basics of R and machine learning. It gradually builds upon core concepts so you can handle the varied complexities of data and understand each stage of the machine learning pipeline. From data collection to implementing Natural Language Processing (NLP), this book covers it all. You will implement key machine learning algorithms to understand how they are used to build smart models. You will cover tasks such as clustering, logistic regressions, random forests, support vector machines, and more. Furthermore, you will also look at more advanced aspects such as training neural networks and topic modeling. By the end of the book, you will be able to apply the concepts of machine learning, deal with data-related problems, and solve them using the powerful yet simple language that is R.
Table of Contents (9 chapters)

Collecting the target variable

We need to determine whether or not a bank has failed in the past – this will be our target. This information is also available on the FDIC website at https://www.fdic.gov/bank/individual/failed/banklist.html.

The website includes banks that have failed since October 2000, which covers all our dataset:

Let's see the steps to achieve this:

  1. Download this information into a .csv file:
download.file("https://www.fdic.gov/bank/individual/failed/banklist.csv", "failed_banks.csv",method="auto", quiet=FALSE, mode = "wb", cacheOK = TRUE)

Even this list is updated periodically, as historical information does not change, but the results are still replicable. Anyway, the file used in the development is also available in the data repository of this book.

  1. Now, upload the downloaded file into R, as follows...