Applying machine learning algorithms – exercises

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 see the solutions to check your answers. Exercise 1 Create a list named “control” that runs a 10-fold cross-validation. HINT: Use trainControl(). Exercise 2 Use the metric of “Accuracy” to evaluate models. Exercise 3 Build the “LDA”, “CART”, “kNN”, “SVM” and…
Original Post: Applying machine learning algorithms – exercises

Visualizing dataset to apply machine learning-exercises

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 see solutions to check your answers. Exercise 1 Create a variable “x” and attach to it the input attributes of the “iris” dataset. HINT: Use columns 1 to 4. Exercise 2 Create a variable “y” and attach to it the output attribute of…
Original Post: Visualizing dataset to apply machine learning-exercises

Summarizing dataset to apply machine learning – exercises

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…
Original Post: Summarizing dataset to apply machine learning – exercises

How to prepare and apply machine learning to your dataset

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. In this step-by-step tutorial you will: 1. Use one of the most popular machine learning packages in R.2. Explore a dataset by using statistical summaries and data visualization.3. Build 5 machine-learning models, pick the best, and build confidence that the accuracy is reliable. The process of a machine learning project may not be exactly the same, but there are certain standard and necessary steps: 1. Define Problem.2. Prepare Data.3. Evaluate Algorithms.4. Improve Results.5. Present Results. 1.…
Original Post: How to prepare and apply machine learning to your dataset

ggvis Exercises (Part-2)

INTRODUCTION The ggvis package is used to make interactive data visualizations. The fact that it combines shiny’s reactive programming model and dplyr’s grammar of data transformation make it a useful tool for data scientists. This package may allows us to implement features like interactivity, but on the other hand every interactive ggvis plot must be connected to a running R session.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 which will include the variables “Horsepower” and “MPG.city” of the “Cars93” data set and make a scatterplot. HINT: Use ggvis() and layer_points(). Exercise 2 Add a slider to the scatterplot of Exercise 1…
Original Post: ggvis Exercises (Part-2)

ggvis Exercises (Part-1)

INTRODUCTION The ggvis package is used to make interactive data visualizations. The fact that it combines shiny’s reactive programming model and dplyr’s grammar of data transformation make it a useful tool for data scientists. This package may allows us to implement features like interactivity, but on the other hand every interactive ggvis plot must be connected to a running R session. 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 which will include the variables “Horsepower” and “MPG.city” of the “Cars93” data set. HINT: Use ggvis(). Exercise 2 Use the list you just created to make a scatterplot. HINT: Use layer_points(). Exercise…
Original Post: ggvis Exercises (Part-1)

How to create interactive data visualizations with ggvis

INTRODUCTION The ggvis package is used to make interactive data visualizations. The fact that it combines shiny’s reactive programming model and dplyr’s grammar of data transformation make it a useful tool for data scientists. This package may allows us to implement features like interactivity, but on the other hand every interactive ggvis plot must be connected to a running R session. PACKAGE INSTALLATION & DATA FRAME The first thing you have to do is install and load the ggvis package with:install.packages(“ggvis”)library(ggvis) Moreover we need a data set to work with. Tha dataset we chose in our case is “Cars93” which contains data from 93 Cars on Sale in the USA in 1993 and we can find it in the MASS package which of course must be installed and called too. To install and call those packages and attach the “Cars93”…
Original Post: How to create interactive data visualizations with ggvis

Data visualization with googleVis exercises part 10

Timeline, Merging & Flash charts This is part 10 of our series and we are going to explore the features of some interesting types of charts that googleVis provides like Timeline, Flash and learn how to merge two googleVis charts to one. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package & Data frame As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) Secondly we will create an experimental data frame which will be used for our charts’ plotting. You can create it with:datTLc <- data.frame(Position=c(rep(“President”, 3), rep(“Vice”, 3)),Name=c(“Washington”, “Adams”, “Jefferson”,”Adams”, “Jefferson”, “Burr”),start=as.Date(x=rep(c(“1789-03-29”, “1797-02-03″,”1801-02-03”),2)),end=as.Date(x=rep(c(“1797-02-03”, “1801-02-03″,”1809-02-03”),2))) You can explore the “datTLC” data…
Original Post: Data visualization with googleVis exercises part 10

R Markdown exercises part 2

INTRODUCTION R Markdown is one of the most popular data science tools and is used to save and execute code, create exceptional reports whice are easily shareable. The documents that R Markdown provides are fully reproducible and support a wide variety of static and dynamic output formats. Using markdown syntax, which provides an easy way of creating documents that can be converted to many other file types, while embeding R code in the report, so it is not necessary to keep the report and R script separately. Furthermore The report is written as normal text, so knowledge of HTML is not required. Of course no additional files are needed because everything is incorporated in the HTML file. Before proceeding, please follow our short tutorial.Look at the examples given and try to understand the logic behind them. Then try to…
Original Post: R Markdown exercises part 2

Data visualization with googleVis exercises part 9

Histogram & Calendar chart This is part 9 of our series and we are going to explore the features of two interesting types of charts that googleVis provides like histogram and calendar charts. Read the examples below to understand the logic of what we are going to do and then test yous skills with the exercise set we prepared for you. Lets begin! Answers to the exercises are available here. Package & Data frame As you already know, the first thing you have to do is install and load the googleVis package with:install.packages(“googleVis”)library(googleVis) To run this example we will first create an experimental data frame with:Hist=data.frame(A=rpois(100, 10),B=rpois(100, 20),C=rpois(100, 30)) NOTE: The charts are created locally by your browser. In case they are not displayed at once press F5 to reload the page. All charts require an Internet connection. Histogram…
Original Post: Data visualization with googleVis exercises part 9