Search This Blog

Tutorial # 10. Machine Learning

Steps for machine Learning Model

#1. Load the dataset
 
View((iris))

#2. Preprocess the dataset

SepalWidth = iris[ ,"C-1"]
SepalLength = iris[ , "C-2"]

print(("\nSepalLength :"))
SepalLength
print(("\nSepalWidth :"))
SepalWidth

#3. Visualze the dataset
 
plot(SepalLength , SepalWidth )
 
Output : 
 
 
 

#4. Creating Machine Learning Model ( Linear Regression )
 
model = lm( SepalWidth ~ SepalLength )

#5. Predict using our ML model
 
predict(model,data.frame(SepalLength=15))
 
Output :  
       1 
3.348169 
 

You may also interested in:

An Introduction to language R
Tutorial # 1.Data Type & Variable  Declaration
Tutorial # 2.Operators
Tutorial # 3.Vector  & Element Access
Tutorial # 4.Matrix
Tutorial # 5.Data Frame
Tutorial # 6.Arrays
Tutorial # 7.Lists
Tutorial # 8.Factors
Tutorial # 9.Data import
Tutorial # 10.Machine Learning
Tutorial # 11.Visualization


Post a Comment

0 Comments