Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

by Ralph Winters
June 2017
Beginner to intermediate
576 pages
15h 22m
English
Packt Publishing
Content preview from Practical Predictive Analytics

Output from the str(df) function

The str() function is an important function to run after you create a new data object. If you examine the output from the str(df) function in the log, you will see that the default read.csv function you have just run has defined each of the variables in the data as either numeric or factor. While at this point it is okay to leave it as is, we will eventually want to change the data type for these variables since Length.of.Stay is not a factor, it is an integer. Alternatively, we can perform another read.csv function that specifies the exact data type that we want, specifying the ColClasses vector. I usually like to look at a small dataset sample first, then determine what the data type should be, and then ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Superstream: Analytics Engineering

Data Superstream: Analytics Engineering

Alistair Croll, Anna Filippova, Emilie Schario, Lewis Davies, Jacob Frackson, Benn Stancil, Nick Acosta, Elizabeth Caley
R: Predictive Analysis

R: Predictive Analysis

Tony Fischetti, Eric Mayor, Rui Miguel Forte
Python: Advanced Predictive Analytics

Python: Advanced Predictive Analytics

Ashish Kumar, Joseph Babcock

Publisher Resources

ISBN: 9781785886188Supplemental Content