Hindi Machine Learning Tutorial 12 - Random Forest
Вставка
- Опубліковано 16 вер 2019
- Random forest is a popular regression and classification algorithm. In this tutorial we will see how it works for classification problem in machine learning. It uses decision tree underneath and forms multiple trees and eventually takes majority vote out of it. We will go over some theory first and then solve digits classification problem using sklearn RandomForestClassifier. In the end we have an exercise for you to solve.
#MachineLearningHindi #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #RandomForest
Code: github.com/codebasics/py/blob...
Exercise: Exercise description is available in above notebook towards the end
To download csv and code for all tutorials: go to github.com/codebasics/py, click on a green button to clone or download the entire repository and then go to relevant folder to get access to that specific file.
Website: codebasicshub.com/
Facebook: / codebasicshub
Twitter: / codebasicshub
Do you want to learn technology from me? Here are my affordable video courses: codebasics.io/?
Sir,
I truly appreciate your teaching skills. you understand what is needed of a learner. I watched all of your videos 1-current. I learned a lot and practiced the exercise also. one request from you, please never delete these videos.
You r a great teacher hand of you sir♥️
Great tutorial. I rarely comment on videos but this was worth it.
Thank u so much sir for this great and easy to understand explanation. I've seen many videos on UA-cam for ML but nobody told that sklearn already have some data sets which we can use. They just start coding what they mugged up.
I appreciate your efforts. You're doing a great job. Please also make videos on SVM, KNN, Naive-Baiyes.
Again thank you so much for this.
Humor in between the video makes learning interesting !!
beautifully explained as always.
thank you so much sir for this simplest explanation. you are the best teacher. Love from Punjab.
I am happy this was helpful to you.
This playlist is also useful for University exam
100% Using n_estimators= 200
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test=train_test_split(df.drop(["target_name","target"],axis=1),df.target,test_size=0.1)
from sklearn.ensemble import RandomForestClassifier
model=RandomForestClassifier(n_estimators=10)
model.fit(X_train,y_train)
model.predict(X_test)
model.score(X_test,y_test)
1.0
from sklearn.preprocessing import StandardScaler
SS=StandardScaler()
x=SS.fit_transform(x)
from sklearn.model_selection import train_test_split
x_train,x_test,y_train,y_test=train_test_split(x,y,test_size=0.20,random_state=10)
model=RandomForestClassifier()
model.fit(x_train,y_train)
model.score(x_test,y_test)
1.0
♥️♥️
Got constant 96% accuracy whether how many times i scale n_estimators from 10-200. Is it ok being not changed so far. Sir!
First default using estimator score = 86%
my n_estimator (n=15) score = 93%
Y is variable depending upon U, V, W, X variables.
Y= f(U,V,W,X)
Y= aU+bV+cW+dW
where a,b,c,d are weights or constants. how can i use AI to assign best weights so that i can get maximum values of Y.
sum of a+b+c+d=1.
please help me to solve this
got an accuracy from 98-99 using 45 trees
hi sir,
i have one continuous dependent variable and 7 independent variable all is categorical ( more than 20 categories in each) variable. should i have to make all into dummy variables ? for reggresion model ?
no you should use label encoding use of dummy variables increase columns
sir why you not take random state?
n_estimators from 10 to 70, score is 100%, from 80 to 100 accuracy dropped to 96%
Good find Farhan
@@codebasicsHindi use standardscaler no need to fine tuning of n_estimater
i continously change n estimator from 10 to 300 but the score remain same
in my case model score is 94%
100% using Random forest iris data
good job. thats an excellent score :)
How to download any csv file from github without cloning the whole repo.
step1:- goto the desired csv file.
step2:- click on it and open it in RAW form.
step3:- now right click your mouse as choose save as.
step4:- now set the path in your computer where you want that file.
step5:- Booya csv file downloaded
ahhh ... great tips. thank you
Sir, add some more interesting video non this playlist.
Sure I will
Codebasics Sir:- Chubby bacha main hu 🤣🤣🤣 lol
i am feeling like a script kiddie , actually I am not coding things using my brain, just copy pasting pre build models , is machine learning that easy? idk , i want to learn something hard
1.0
N_estimater 10 and 20 is 1.0
N_estimater 5 is 0.9916666666666
my score 0.9