Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
R Machine Learning By Example

You're reading from  R Machine Learning By Example

Product type Book
Published in Mar 2016
Publisher
ISBN-13 9781784390846
Pages 340 pages
Edition 1st Edition
Languages
Author (1):
Raghav Bali Raghav Bali

Table of Contents (15) Chapters

R Machine Learning By Example
Credits
About the Authors
About the Reviewer
www.PacktPub.com
Preface
Getting Started with R and Machine Learning Let's Help Machines Learn Predicting Customer Shopping Trends with Market Basket Analysis Building a Product Recommendation System Credit Risk Detection and Prediction – Descriptive Analytics Credit Risk Detection and Prediction – Predictive Analytics Social Media Analysis – Analyzing Twitter Data Sentiment Analysis of Twitter Data Index

Modeling using logistic regression


Logistic regression is a type of regression model where the dependent or class variable is not continuous but categorical, just as in our case, credit rating is the dependent variable with two classes. In principle, logistic regression is usually perceived as a special case of the family of generalized linear models. This model functions by trying to find out the relationship between the class variable and the other independent feature variables by estimating probabilities. It uses the logistic or sigmoid function for estimating these probabilities. Logistic regression does not predict classes directly but the probability of the outcome. For our model, since we are dealing with a binary classification problem, we will be dealing with binomial logistic regression.

First we will load the library dependencies as follows and separate the testing feature and class variables:

library(caret) # model training and evaluation
library(ROCR) # model evaluation
source...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}