Below are the solutions to these exercises on basic tree ############### # # # Exercise 1 # # # ############### lens=read.csv("C:/Contract/lens/lenses.csv") str(lens) ## ‘data.frame’: 23 obs. of 6 variables: ## $ X1 : int 2 3 4 5 6 7 8 9 10 11 … ## $ X1.1: int 1 1 1 1 1 1 […]

## Basic Tree 1 Exercises

Using the knowledge you acquired in the previous exercises on sampling and selecting(here), we will now go through an entire data analysis process. You will be using what you know as crutches to solve the problems. Don’t worry. It might look intimidating but follow the sequence and you will see that modeling a decision tree […]

## Select and Query Exercise

In this exercise we cover the basics on selecting and extracting data using queries. We add a few other materials into it. This should prepare you for the next exercise: Basic Decision Tree. The purpose of this is to give you the 20 percent of the tools to get 80 percent of work done. You […]

## Select and Query Solutions

Below are the solutions to these exercises on selecting and querying data ############### # # # Exercise 1 # # # ############### a=c(4,5,6,8,3) b=c("apple","chair","jetplane","salmon","island") c=c(TRUE,TRUE,FALSE,TRUE,FALSE) ############### # # # Exercise 2 # # # ############### df=data.frame(a,b,c) ############### # # # Exercise 3 # # # ############### str(df) ## ‘data.frame’: 5 obs. of 3 variables: ## […]

## Model Evaluation Exercises 1

We are committed to bringing you 100% authentic exercise sets. We even try to include as different datasets as possible to give you an understanding of different problems. No more classifying Titanic dataset. R has tons of datasets in its library. This is to encourage you to try as many datasets as possible. We will […]

## Model Evaluation Solutions 1

Below are the solutions to these exercises on model evaluation ############### # # # Exercise 1 # # # ############### 3/5 ## [1] 0.6 3/7 ## [1] 0.4285714 ############### # # # Exercise 2 # # # ############### 100 ## [1] 100 24 ## [1] 24 94 ## [1] 94 23 ## [1] 23 ############### […]

## Frequency and chi-square test for independence Exercises

In this exercise, we cover some basics on frequency tables. We also briefly look at chi-square test for independence to find relationships of two variables. Before proceeding, it might be helpful to look over the help pages for the table, summary, and margin.table functions. Answers to the exercises are available here. If you obtained a […]

## Frequency and chi-square test for independence Solutions

Below are the solutions to these exercises on frequency and chi-square test ############### # # # Exercise 1 # # # ############### attach(trees) ############### # # # Exercise 2 # # # ############### mytable=table(trees$Height,trees$Volume) ############### # # # Exercise 3 # # # ############### margin.table(mytable, 1) ## ## 63 64 65 66 69 70 71 […]

## Sampling Exercise Part 1

In this Exercise, we will dive quickly through some basic sampling methods. Follow along this series to use these methods later for our decision trees modelling exercise. We will sample using the package caTools and caret. This is a beginner level exercise. Please refer to the help section for set.seed(), sample.split(),createDataPartition(), and createFolds() functions. You […]

## Sampling Solutions Part 1

Below are the solutions to these exercises on sorting and ordering. ############### # # # Exercise 1 # # # ############### library(caTools) attach(iris) ############### # # # Exercise 2 # # # ############### set.seed(100) ############### # # # Exercise 3 # # # ############### split=sample.split(iris$Species,SplitRatio=0.7) ############### # # # Exercise 4 # # # ############### […]