Here you will find daily news and tutorials about R, contributed by hundreds of bloggers.
There are many ways to follow us - By e-mail:On Facebook: If you are an R blogger yourself you are invited to add your own R content feed to this site (Non-English R bloggers should add themselves- here)

[This article was first published on R-exercises, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

INTRODUCTION

Dear reader,

If you are a newbie in the world of machine learning, then this tutorial is exactly what you need in order to introduce yourself to this exciting new part of the data science world.

This post includes a full machine learning project that will guide you step by step to create a “template,” which you can use later on other datasets.

Before proceeding, please follow our short tutorial.

Look at the examples given and try to understand the logic behind them. Then try to solve the exercises below using R and without looking at the answers. Then check the solutions. to check your answers.

Exercise 1

Create a list of 80% of the rows in the original dataset to use for training. HINT: Use createDataPartition().

Exercise 2

Select 20% of the data for validation.

Exercise 3

Use the remaining 80% of data to train and test the models.

Exercise 4

Find the dimensions of the “iris” dataset. HINT: Use dim().