Hindi Machine Learning Tutorial 6 - Dummy Variables & One Hot Encoding
Вставка
- Опубліковано 14 жов 2024
- Machine learning models work very well for dataset having only numbers. But how do we handle text information in dataset? Simple approach is to use interger or label encoding but when categorical variables are nominal, using simple label encoding can be problematic. One hot encoding is the technique that can help in this situation. In this tutorial, we will use pandas get_dummies method to create dummy variables that allows us to perform one hot encoding on given dataset. Alternatively we can use sklearn.preprocessing OneHotEncoder as well to create dummy variables.
#MachineLearningHindi #PythonMachineLearning #MachineLearningTutorial #Python #PythonTutorial #PythonTraining #MachineLearningCource #OneHotEncoding
Code in tutorial: github.com/cod...
Exercise csv file: github.com/cod...
To download csv and code for all tutorials: go to github.com/cod..., 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
Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced
Why did u use.. Model. Predict([[ 👈 3 brackets over here..?
I must say that you have a kind of inexplicable calm way of describing , that really helped . The problem with some hindi channels is that they don't care much about the aesthetics of teaching . You are different
I think everything is easy to learn if you have a real tutor like you Sir
Salute ❤
Form pakistan
I came from english codebasics channel 😎. I didn't knew another legendary data science channel exist . 🙏🙏
Sir its giving error
TypeError: __init__() got an unexpected keyword argument 'categorical_features'
i am also facing the same
Your way of teaching is just amazing I am glad that i found your channel
Glad to hear that
First technique was easier..
Is it okay to use it instead of the 2nd one ??
Sir, here we have only 3 towns that why we drop one town after concat dummy variable with dataset. if here 5 or 10 types of town then how it works?
sir if we have labeled using labelencoder it is giving same as pandas dummy variable so why we are further using fit_transform of onehotencoding
good learning, thank you so much dhaval sir.
Sir, What is the difference between pandas get dummy method and one hot encoding? It is doing same thing only..
yes they are similar.
Hello sir,
I really glad that i am learning ML from you.
I am doing Exercise
1st use label encoder
Then use linear regression
Score is 0.87199
Sir how we plot scatter on multi linear regression?
hi, please guide me i m doing prepration of data scientist ,please
If there were 3 categories, we needed to drop one column.
What to do when we have more than 3 ?
Still we need to remove 1 column or more?
Why he removed west windsor column?
Sir in my categorical command not working, any problem, reply Sir
mercedes benz, 4 yrs, 45K mileage: model.predict([[0, 1, 45000, 4]]) predicted: array([36991.31721062])
BMW X5, 7 yrs, 86K mileage: model.predict([[1, 0, 86000, 7]]) predicted: array([11080.74313219])
score: 0.9417050937281083
Can you please confirm if it is correct or not?
Perfect answer Farhan. Good job, you are awesome :)
You explained it nicely. Thank you
I got the same answer. Cheers
I got the same ,
Thanks :)
there is no categorical_features in OneHotEncoder
Thanks For calling us smart
Bhai Mahaan hen ap
Hello Sir , I hope ur fine in this pandemic situation :) :) sir I got the exercise answer perfectly fine with dummy variable method but when i'm doing this with one hot encoding method it did not give the correct answer and you also in ur github doing it with first method
Sir can you tell me how to convert continuous value to discrete value !!!
Categorical feature not work in One hot encoding.please help
My score is coming out to be 0.9688...
But the given solution is not matching my answer. Is this possible?
I have given the same data set as provided... Please tell🙏
if categorical_features = [1] not working
use this one:
from sklearn.compose import ColumnTransformer
ct = ColumnTransformer([("town", OneHotEncoder(), [0])], remainder = 'passthrough')
x=ct.fit_transform(x)
Thank you Brother
Thanks
👌
👍
Appreciated!
Dear, would u like to explain how we deploy or import our trained data into web app?
Amazing just amazing
Glad it was helpful!
prabhu apne bhakto k liye aur zyada se zyada video banaye na
1.model.predict([[0,1,45000,4]])
array([[36991.31721062]])
2. model.predict([[0,0,86000,7]])
array([[15365.40972059]])
3.model.score(x,y)
0.9417050937281083
Nice
Thanks Sir great learning just 1 qs chalo means😅
sir, I am not getting the csv files from the provided link.plz help me out
Fahim can you go to root directory and download the entire py repository? I think I have provided instructions in video description
aapki 4 hi columns aa rhi hn dummy variable ki lekin meri 7 aa rhi hn....(one hot encoder se) koi btade plzzzz
Thank you very much for your efforts. Love from Pakistan.
How to do this when there are many categorical columns?
what are u doing now ? please share your thought
mercedes benz c class, 4 yrs, 45000 mileage: model.predict([[ 45000,4,0,1]]) predicted: array([36991.31721061])
BMW X5, 7 yrs, 86K mileage: model.predict([[86000, 7,1,0]]) predicted: array([11080.74313219])
model.score(x,y):0.9417050937281082
Sir please help me out resolving that error
which one?
1st answer is 36991
and 2nd is 15365
14:48 One hot encoder naam ekdam hot hai
I am getting error in this
what are u doing now ? please share your thoughts ?
Where?