From the course: Complete Your First Project in R
Unlock the full course today
Join today to access over 24,000 courses taught by industry experts.
How to prepare data for classification
From the course: Complete Your First Project in R
How to prepare data for classification
- [Instructor] To begin your classification analysis, you will need to do a few things to prepare the data for the machine learning algorithms. First, make sure you run the top section of your code to load in the data. First, you will be creating two new columns of data with the order month and the order year. These will be more useful in the algorithms than having the exact dates. You can use the format function to do this. Begin by creating a new column called OrderMonth and you will assign this to the value you get by using the format function on the sales$OrderDate column. And for this one, you will want to have the value B% in uppercase B. This particular code is used to specify when you want to return the month name from a date. So if you look at the summary of this sales data, once you add in this new column, you can scroll down and now you see you have an OrderMonth column that is in a character format. You can copy and paste this code to then gather the order year. So you'll…
Contents
-
-
-
-
(Locked)
Understanding classification analysis3m 55s
-
(Locked)
How to prepare data for classification6m 31s
-
(Locked)
How to run a decision tree algorithm7m 9s
-
(Locked)
How to run a random forest algorithm4m 3s
-
(Locked)
How to run a support vector machine algorithm3m 11s
-
(Locked)
Understanding summary metrics2m 38s
-
(Locked)
How to decide which algorithm is best3m 56s
-
(Locked)
How to improve the chosen algorithm5m 59s
-
(Locked)
Challenge: Explore the chosen algorithm1m 36s
-
(Locked)
Solution: Explore the chosen algorithm4m 38s
-
(Locked)
-
-