Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Machine Learning with R Quick Start Guide
Machine Learning with R Quick Start Guide

Machine Learning with R Quick Start Guide: A beginner's guide to implementing machine learning techniques from scratch using R 3.5

eBook
₱1346.99
Paperback
₱1683.99
Subscription
Free Trial

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning
Table of content icon View table of contents Preview book icon Preview Book

Machine Learning with R Quick Start Guide

Predicting Failures of Banks - Data Collection

In each model development, we will need to obtain enough data to build the model. It is very common to read the expression garbage in, garbage out, which relates to the fact that if you develop a model with bad data, the resulting model will be also bad.

Especially in machine learning applications, what we expect is to have a huge amount of data, although in many cases that's not the case. Regardless of the amount of information available, the quality of this data is the most important issue.

Moreover, as a developer, it is important to have structured data, because it can be immediately manipulated. However, data is commonly found in an unstructured form, meaning that it takes a lot of time to process and prepare for development. Many people consider machine learning applications to only be based on the use of new algorithms...

Collecting financial data

We will obtain our data from the Federal Deposit Insurance Corporation (FDIC) website (https://www.fdic.gov/). The FDIC is an independent agency led by the US Congress with an aim to maintain the confidence of the people and the stability of the financial system.

Why FDIC?

FDIC provides deposit insurance to depositors in US commercial banks and savings institutions. Thus, if a US bank fails and closes, the FDIC guarantees that the depositors do not lose their savings. Up to US$250,000 is guaranteed.

The FDIC also examines and supervises certain financial institutions. These institutions are obliged to periodically report detailed information about their financial statements related to the following...

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...

Structuring data

After having acquired our target variable and knowing our dataset, we can now move on to the actual data collection based on our target. Here, we will try acquiring the data of the bank according to different years as described in the Collecting the target variable section.

To do this, we create a new variable extracting only the year when a bank went bankrupt, and then we count the number of banks by year:

failed_banks$year<-as.numeric(format(failed_banks$Closing.Date, "%Y"))

Failed_by_Year<-as.data.frame(table(failed_banks$year))
colnames(Failed_by_Year)<-c("year","Number_of_banks")

print(Failed_by_Year)
## year Number_of_banks
## 1 2000 2
## 2 2001 4
## 3 2002 11
## 4 2003 3
## 5 2004 4
## 6 2007 3
## 7 2008 25
...

Summary

In this chapter, we have started collecting the data needed to develop our model to predict bank failures. In this case, we have downloaded a large amount of data and we have structured it. Moreover, we have created our target variable. At the end of this chapter, you should have learned that data collection is the first and one of the most important steps in the model development. When you deal with your own problems, take time to understand the problem and then think about what kind of data you need and how to obtain it. In the next chapter, we will do a descriptive analysis of the data that we have acquired.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Use R 3.5 to implement real-world examples in machine learning
  • Implement key machine learning algorithms to understand the working mechanism of smart models
  • Create end-to-end machine learning pipelines using modern libraries from the R ecosystem

Description

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.

Who is this book for?

This book is for graduate students, aspiring data scientists, and data analysts who wish to enter the field of machine learning and are looking to implement machine learning techniques and methodologies from scratch using R 3.5. A working knowledge of the R programming language is expected.

What you will learn

  • Introduce yourself to the basics of machine learning with R 3.5
  • Get to grips with R techniques for cleaning and preparing your data for analysis and visualize your results
  • Learn to build predictive models with the help of various machine learning techniques
  • Use R to visualize data spread across multiple dimensions and extract useful features
  • Use interactive data analysis with R to get insights into data
  • Implement supervised and unsupervised learning, and NLP using R libraries

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Mar 29, 2019
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781838647056
Category :
Languages :
Tools :

What do you get with eBook?

Product feature icon Instant access to your Digital eBook purchase
Product feature icon Download this book in EPUB and PDF formats
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
Product feature icon AI Assistant (beta) to help accelerate your learning

Product Details

Publication date : Mar 29, 2019
Length: 250 pages
Edition : 1st
Language : English
ISBN-13 : 9781838647056
Category :
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just ₱260 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total 5,307.97
Mastering Machine Learning with R
₱2245.99
Machine Learning with R Quick Start Guide
₱1683.99
R Statistics Cookbook
₱1377.99
Total 5,307.97 Stars icon

Table of Contents

8 Chapters
R Fundamentals for Machine Learning Chevron down icon Chevron up icon
Predicting Failures of Banks - Data Collection Chevron down icon Chevron up icon
Predicting Failures of Banks - Descriptive Analysis Chevron down icon Chevron up icon
Predicting Failures of Banks - Univariate Analysis Chevron down icon Chevron up icon
Predicting Failures of Banks - Multivariate Analysis Chevron down icon Chevron up icon
Visualizing Economic Problems in the European Union Chevron down icon Chevron up icon
Sovereign Crisis - NLP and Topic Modeling Chevron down icon Chevron up icon
Other Books You May Enjoy Chevron down icon Chevron up icon

Customer reviews

Rating distribution
Full star icon Full star icon Full star icon Full star icon Full star icon 5
(1 Ratings)
5 star 100%
4 star 0%
3 star 0%
2 star 0%
1 star 0%
Joaq_32 Apr 22, 2019
Full star icon Full star icon Full star icon Full star icon Full star icon 5
Aunque no me ha dado tiempo a leerlo entero, los casos y el código mostrado parecen muy fiables a los problemas que me he encontrado yo a la hora de desarrollar aplicaciones de machine learning. Buena compra
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

How do I buy and download an eBook? Chevron down icon Chevron up icon

Where there is an eBook version of a title available, you can buy it from the book details for that title. Add either the standalone eBook or the eBook and print book bundle to your shopping cart. Your eBook will show in your cart as a product on its own. After completing checkout and payment in the normal way, you will receive your receipt on the screen containing a link to a personalised PDF download file. This link will remain active for 30 days. You can download backup copies of the file by logging in to your account at any time.

If you already have Adobe reader installed, then clicking on the link will download and open the PDF file directly. If you don't, then save the PDF file on your machine and download the Reader to view it.

Please Note: Packt eBooks are non-returnable and non-refundable.

Packt eBook and Licensing When you buy an eBook from Packt Publishing, completing your purchase means you accept the terms of our licence agreement. Please read the full text of the agreement. In it we have tried to balance the need for the ebook to be usable for you the reader with our needs to protect the rights of us as Publishers and of our authors. In summary, the agreement says:

  • You may make copies of your eBook for your own use onto any machine
  • You may not pass copies of the eBook on to anyone else
How can I make a purchase on your website? Chevron down icon Chevron up icon

If you want to purchase a video course, eBook or Bundle (Print+eBook) please follow below steps:

  1. Register on our website using your email address and the password.
  2. Search for the title by name or ISBN using the search option.
  3. Select the title you want to purchase.
  4. Choose the format you wish to purchase the title in; if you order the Print Book, you get a free eBook copy of the same title. 
  5. Proceed with the checkout process (payment to be made using Credit Card, Debit Cart, or PayPal)
Where can I access support around an eBook? Chevron down icon Chevron up icon
  • If you experience a problem with using or installing Adobe Reader, the contact Adobe directly.
  • To view the errata for the book, see www.packtpub.com/support and view the pages for the title you have.
  • To view your account details or to download a new copy of the book go to www.packtpub.com/account
  • To contact us directly if a problem is not resolved, use www.packtpub.com/contact-us
What eBook formats do Packt support? Chevron down icon Chevron up icon

Our eBooks are currently available in a variety of formats such as PDF and ePubs. In the future, this may well change with trends and development in technology, but please note that our PDFs are not Adobe eBook Reader format, which has greater restrictions on security.

You will need to use Adobe Reader v9 or later in order to read Packt's PDF eBooks.

What are the benefits of eBooks? Chevron down icon Chevron up icon
  • You can get the information you need immediately
  • You can easily take them with you on a laptop
  • You can download them an unlimited number of times
  • You can print them out
  • They are copy-paste enabled
  • They are searchable
  • There is no password protection
  • They are lower price than print
  • They save resources and space
What is an eBook? Chevron down icon Chevron up icon

Packt eBooks are a complete electronic version of the print edition, available in PDF and ePub formats. Every piece of content down to the page numbering is the same. Because we save the costs of printing and shipping the book to you, we are able to offer eBooks at a lower cost than print editions.

When you have purchased an eBook, simply login to your account and click on the link in Your Download Area. We recommend you saving the file to your hard drive before opening it.

For optimal viewing of our eBooks, we recommend you download and install the free Adobe Reader version 9.