Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
95 views
Machine Learning Cheatsheet
Uploaded by
Kaushik Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Machine Learning Cheatsheet For Later
Download
Save
Save Machine Learning Cheatsheet For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
95 views
Machine Learning Cheatsheet
Uploaded by
Kaushik Das
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as PDF or read online on Scribd
Download now
Download
Save Machine Learning Cheatsheet For Later
Carousel Previous
Carousel Next
Download
Save
Save Machine Learning Cheatsheet For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 5
Search
Fullscreen
CHEATSHEET ine Learni Mac @ Algor thms @ ( Python and R Codes) T Supervised Learning Decision Tree -Random Forest “KAN Logistic Regression pes Unsupervised Learning -Apriori algorithm - k-means Hierarchical Clustering Reinforcement Learning - Markov Decision Process -Q Learning Python Code Code ‘import Library #Import other necessary Libraries Like pandas, finumpy. from sklearn Inport Linear model Load Train and Test datasets Identify feature and response variable(s) and values must be numeric and nunpy arrays input_variables_values training datasets ytralnetarget_variables_values_teaining datasets x test=input_variables_values_test_datasets xtra Create Linear regression object Linear = linear_model.LinearRegression() Linear Train the model using the training sets and check score Linear-fit(x_train, y_train) Linear.score(x train, y_train) =| = A n fy = a o ce Equation coefficient and Intercept print( ‘Coefficient: \n', linear.coef_) print(‘Intercept: \n', Linear.intercept_) Predict Output, predicted= linear.predict(x test) ‘Load Train and Test datasets Identify feature and response variable(s) and values must be numeric and numpy arrays x train © input_variables values training datasets y.train <- tanget_variables_values training datasets xLtest <- input_variables_values_test_datasets x <= cbind(x_train,y_train) Train the model using the training sets and Heheck score Linear <- In(y_train = ., data = x) summary (Linear) Predict Output predicteds predict (Linear, x test)[4 reyes egression import Library from sklearn-Linear_nodel import LogisticRegression ‘assumed you have, X (predictor) and ¥ (target) for training data set and x_test(predictor) fof test_dataset create logistic regression object Logistickegression() ‘Train the model using the training sets and check score nodel-fit(, y) mmodel.score(x, y) Equation coefficient and Intercept print( ‘Coefficient: \n', model.coef_) print("Intercept: \n", model.intercept_) Horedict Output predicted model.predict(x test) rede) x & chind(x train y train) HIrain the model. using the training sets and check logistic <- glaly train = ., data x, fanily="binenial")| ‘summary (Logistic) aPredict Output predicted predict(logistic,x test) Tree is = cy LH import Library import other necessary libraries like pandas, numy... from sklearn inport tree Assumed you have, X (predictor) and Y (target) for training data set and x test (predictor) of ‘ttest_dataset ficreate tree object node ‘tree.DecisionTreeClassifien(criterion='gint") fer classification, here you can change the algorithm as gini on entropy (information gain) by default it is gini nedel = tree.Decisiontreekegressor() for ttregression ‘Train the model using the training sets and check model -F54(X, y) sodel.score(x, y) Predict output predicted: model. predict (x test) report Library Library(rpart) x & cbind(x train,y train) fterow tree fit < rpart(y_train ~ ., data = summary (Fit) WPredict Output predicted predict(Fit,x test) xymethod="class")SVM (Support Vector Machine) #Import Library from sklearn import svm #Assumed you have, X (predictor) and Y (target) for #training data set and x_test(predictor) of test_dataset #Create SVM classification object model = svm.sve() fithere are various options associated with it, this is simple for classification. #Train the model using the training sets and check score model. Fit(X, y) model.score(X, y) #Predict Output predicted= nodel.predict(x test #Import Library Library(e1@71) X <- cbind(x_train,y train) a#Fitting model fit <-sum(y_train ~ ., data summary (Fit) #Predict Output predicted= predict (fit,x_test) Naive Bayes Import Library from sklearn.naive_bayes import GaussianNs Assumed you have, K (predictor) and ¥ (target) for #training data set and x_test(predictor) of test_dataset Create SVM classification object model = GaussianNa() there is other distribution for multinomial classes Like Bernoulli Naive Bayes #Train the model using the training sets and check score model. fit(X, y) Predict Output predicted= model. predict(x_test) Import Library Library(e1@71) x <- cbind(x_train,y train) Fitting model fit <-naiveBayes(y_train ~ ., data = x) sumnary(fit) Predict Output predicted= predict (fit.x_test)a — r= = Bi 2 = SI i rs 5 3 Es = = 3 g S Fa 2 Fy 5 a Inport Library from sklearn import decomposition ‘Assumed you have training and test data set as train and atest Create PCA object pca= decomposition. PCA(n_conponents=k) default value of k =nin(n_sanple, n features) For Factor analysis faz decomposition. FactorAnalysis() ‘Reduced the dimension of training dataset using PCA train_reduced = pca.fit_transfora(train) ‘Reduced the dimension of test dataset test_reduced = pca.transform(test) #inport, Library Library (stats) pca < princomp(train, cor = TRUE) train_reduced <- predict(pca,train) test_reduced <- predict(pca,test) Gradient Boosting & AdaBoost #Inport Library from sklearn.ensemble import GradientBoostingClassifier #Assumed you have, X (predictor) and Y (target) for straining data set and x _test(predictor) of test_dataset #Create Gradient Boosting Classifier object nodel= GradientBoostingClassifier(n_estinators=100, \ learning_rate=1.0, max_depth=1, random_stat #Train the model using the training sets and check score nodel Fit (x, y) #Predict Output predicted= model predict (x_test) #Import Library Library(caret) x < cbind(x_train,y train) #Fitting model FitControl <- trainControl( method = “repeatedc + number = 4, repeats = 4) Fit <- train(y ~ ., data = x, method = "gb itControl, verbose = FALSE) predict(fit,x_test, type= “prob")[,2] + trControl predicteie 5 3 = S ry 2 rd s g 3 2 cS z tS = ‘import Library from skleara.neighbors import KNeighborsClassifier ‘Assumed you have, X (predictor) and ¥ (target) for training data set and x test(predictor) of test dataset create KNeightors classifier object aodel ne ighborsclassifier(n_neighbor: ‘default value for a_neighvors is 5 ‘irain the model using the training sets and check score node Fit(X, 9) Predict Output predicted model.predict(x test) Import Library Library (kan) x & cbind(x_train,y_train) ‘eFitting model Fit
You might also like
(Ebook) Machine Learning Algorithms in Depth (MEAP V01) by Vadim Smolyakov ISBN 9781633439214, 1633439216 download pdf
PDF
100% (5)
(Ebook) Machine Learning Algorithms in Depth (MEAP V01) by Vadim Smolyakov ISBN 9781633439214, 1633439216 download pdf
81 pages
A Hands-On Introduction To Data Science
PDF
No ratings yet
A Hands-On Introduction To Data Science
2 pages
Great Learning Notes
PDF
No ratings yet
Great Learning Notes
1 page
Class Material - 1
PDF
No ratings yet
Class Material - 1
66 pages
Data Analytics in Hospitality Industry
PDF
No ratings yet
Data Analytics in Hospitality Industry
13 pages
19 Storytelling PDF
PDF
No ratings yet
19 Storytelling PDF
64 pages
Introduction To K-Nearest Neighbors: Simplified (With Implementation in Python)
PDF
100% (1)
Introduction To K-Nearest Neighbors: Simplified (With Implementation in Python)
125 pages
AIML Online
PDF
No ratings yet
AIML Online
16 pages
Simple Linear Regression - Assign3
PDF
No ratings yet
Simple Linear Regression - Assign3
8 pages
Upgrad ML
PDF
100% (1)
Upgrad ML
7 pages
Parallelism of Statistics and Machine Learning & Logistic Regression Versus Random Forest
PDF
100% (1)
Parallelism of Statistics and Machine Learning & Logistic Regression Versus Random Forest
72 pages
Notes On Machine Learning
PDF
No ratings yet
Notes On Machine Learning
2 pages
ML Notes
PDF
100% (2)
ML Notes
125 pages
Data Science Interview Questions
PDF
100% (1)
Data Science Interview Questions
68 pages
Machine Learning Guide Line
PDF
No ratings yet
Machine Learning Guide Line
10 pages
Introduction To Machine Learning (CS419M)
PDF
No ratings yet
Introduction To Machine Learning (CS419M)
25 pages
Linear Regression
PDF
100% (1)
Linear Regression
51 pages
Machine Learning Revision Notes
PDF
No ratings yet
Machine Learning Revision Notes
6 pages
Machine Learning Project Basic - Linear Regression - Kaggle
PDF
No ratings yet
Machine Learning Project Basic - Linear Regression - Kaggle
10 pages
Linear Regression With LM Function, Diagnostic Plots, Interaction Term, Non-Linear Transformation of The Predictors, Qualitative Predictors
PDF
100% (1)
Linear Regression With LM Function, Diagnostic Plots, Interaction Term, Non-Linear Transformation of The Predictors, Qualitative Predictors
15 pages
The Complete Guide To Data Preprocessing
PDF
No ratings yet
The Complete Guide To Data Preprocessing
50 pages
Poly
PDF
100% (1)
Poly
108 pages
Data Science Masters 2.0: Impact Batch 2.0
PDF
No ratings yet
Data Science Masters 2.0: Impact Batch 2.0
11 pages
Curse of Dimensionality
PDF
No ratings yet
Curse of Dimensionality
9 pages
Data Science Notes
PDF
No ratings yet
Data Science Notes
36 pages
Machine Learning C
PDF
No ratings yet
Machine Learning C
24 pages
Matplotlib PDF
PDF
No ratings yet
Matplotlib PDF
16 pages
ML Projects 1
PDF
No ratings yet
ML Projects 1
29 pages
MACHINE LEARNING ALGORITHM Unit-II
PDF
No ratings yet
MACHINE LEARNING ALGORITHM Unit-II
115 pages
Face Detection & Emotion Recognition
PDF
No ratings yet
Face Detection & Emotion Recognition
26 pages
Machine Learning Hands-On
PDF
100% (1)
Machine Learning Hands-On
18 pages
Complete Statistical Methods For Machine Learning: Discover How To Transform Data Into Knowledge With Python Jason Brownlee PDF For All Chapters
PDF
100% (2)
Complete Statistical Methods For Machine Learning: Discover How To Transform Data Into Knowledge With Python Jason Brownlee PDF For All Chapters
62 pages
Python Numpy (1) : Intro To Multi-Dimensional Array & Numerical Linear Algebra
PDF
100% (1)
Python Numpy (1) : Intro To Multi-Dimensional Array & Numerical Linear Algebra
27 pages
Classification With Decision Trees: Instructor: Qiang Yang
PDF
100% (1)
Classification With Decision Trees: Instructor: Qiang Yang
62 pages
Exploratory Data Analysis
PDF
No ratings yet
Exploratory Data Analysis
22 pages
Python Vs R in Data and Machine Learning PDF
PDF
100% (1)
Python Vs R in Data and Machine Learning PDF
6 pages
Iot Systems - Logical Design Using Python: Bahga & Madisetti, © 2015
PDF
No ratings yet
Iot Systems - Logical Design Using Python: Bahga & Madisetti, © 2015
31 pages
Machine Learning: Bilal Khan
PDF
100% (2)
Machine Learning: Bilal Khan
20 pages
(New) (New) ML KNN Introduction Handwritten Notes
PDF
No ratings yet
(New) (New) ML KNN Introduction Handwritten Notes
6 pages
Detailed Curriculum PDF
PDF
No ratings yet
Detailed Curriculum PDF
6 pages
Data Science - A Kaggle Walkthrough - Understanding The Data - 2 PDF
PDF
No ratings yet
Data Science - A Kaggle Walkthrough - Understanding The Data - 2 PDF
9 pages
Sajjad DS
PDF
100% (2)
Sajjad DS
97 pages
ML MU Unit 2
PDF
100% (2)
ML MU Unit 2
42 pages
Data Science - Sem6
PDF
100% (3)
Data Science - Sem6
118 pages
Data Science Use Cases
PDF
100% (1)
Data Science Use Cases
10 pages
Pandas
PDF
100% (1)
Pandas
1,131 pages
Assignment 1 B2019010
PDF
No ratings yet
Assignment 1 B2019010
9 pages
Data Science Interview Questions 2019
PDF
No ratings yet
Data Science Interview Questions 2019
16 pages
CCS355 Neural Networks and Deep Learning Lab
PDF
No ratings yet
CCS355 Neural Networks and Deep Learning Lab
43 pages
Machine Learning With Real Life Project: by - Rishabh Gaur
PDF
100% (2)
Machine Learning With Real Life Project: by - Rishabh Gaur
26 pages
Kaggle: Your Machine Learning and Data Science Community
PDF
No ratings yet
Kaggle: Your Machine Learning and Data Science Community
7 pages
Machine Learning Notes
PDF
No ratings yet
Machine Learning Notes
27 pages
Lecture 4 Linear Regression
PDF
100% (1)
Lecture 4 Linear Regression
44 pages
Get Feature Engineering Bookcamp 1st Edition Sinan Ozdemir free all chapters
PDF
100% (2)
Get Feature Engineering Bookcamp 1st Edition Sinan Ozdemir free all chapters
55 pages
Data Science Course Agenda
PDF
No ratings yet
Data Science Course Agenda
29 pages
Tutorial On "R" Programming Language
PDF
No ratings yet
Tutorial On "R" Programming Language
25 pages
Chapter 7 - Regression Analysis
PDF
100% (1)
Chapter 7 - Regression Analysis
111 pages
Data Science Tutorial Library - 370+ Free Tutorials
PDF
100% (1)
Data Science Tutorial Library - 370+ Free Tutorials
14 pages
ML Cheatsheet
PDF
No ratings yet
ML Cheatsheet
4 pages
ML Algorithms
PDF
100% (1)
ML Algorithms
1 page
Top Human Resource Email List - Part 5
PDF
No ratings yet
Top Human Resource Email List - Part 5
12 pages
Data Scientist Program - Upfront 1
PDF
No ratings yet
Data Scientist Program - Upfront 1
7 pages
Clinical Research JDs
PDF
No ratings yet
Clinical Research JDs
4 pages
Capstones AIML and DS Capstone Projects
PDF
No ratings yet
Capstones AIML and DS Capstone Projects
6 pages
Top 25 YouTube Channels
PDF
No ratings yet
Top 25 YouTube Channels
7 pages
Visual Summary of Atomic Habits by James Clear (Part 1)
PDF
No ratings yet
Visual Summary of Atomic Habits by James Clear (Part 1)
15 pages