Customer churn prediction using ANN | Deep Learning Tutorial 18 (Tensorflow2.0, Keras & Python)

  Рет қаралды 201,611

codebasics

codebasics

Күн бұрын

Пікірлер: 220
@codebasics
@codebasics 2 жыл бұрын
Check out our premium machine learning course with 2 Industry projects: codebasics.io/courses/machine-learning-for-data-science-beginners-to-advanced
@MrMadmaggot
@MrMadmaggot 2 жыл бұрын
Dude I ran a similar churn model with three outcomes. When I run the dataset without oversample the NN gives me a nice accuracy. When I run the dataset WITH oversample, somehow the NN gives me a very bad accuracy. WHY?
@humanandlifefacts9217
@humanandlifefacts9217 Жыл бұрын
the dataset has already column if a customer churned or not. Then what are we really predicting ?
@amitmishra5474
@amitmishra5474 Жыл бұрын
Hi Sir! at 29:04 why are you calling first layer as ''Hidden layer"? I think first layer should be Input layer. I am confused.
@codebasics
@codebasics 4 жыл бұрын
Clarification: This video was just to demonstrate how to build neural network for structured dataset like customer churn. However there is an imbalance in this dataset (number of samples with churn=Yes are much less than churn=No), I will add a new video in this series showing how to handle this imbalance. That will improve the f1 score.
@darullshifa4870
@darullshifa4870 4 жыл бұрын
sir i want to do my MS thesis on Churn prediction. is it possible to use this code and make it???
@omkarg01
@omkarg01 4 жыл бұрын
At 11:54 you said green mean customer staying and red means customer leaving, and at 13:15 you said opposite of that, plz clear the statement. BTW your videos are helping so much!
@symmercool7672
@symmercool7672 3 жыл бұрын
Hello May be I missed it, but what's your name please? I had to run all your videos at 2x speed else I would have slept or got distracted...hahaha I have been following all your videos and they are all extremely helpful. Thanks for your efforts :)
@AlonAvramson
@AlonAvramson 3 жыл бұрын
You have such an amazing talent to simplify complex issues and explain them so they look simple. It comes with a lot of hard work and it is very very much appreciated .
@fadilyassin4597
@fadilyassin4597 Жыл бұрын
cleaning the data is very very essential i any project what you did in this project is very good hope you do more advanced video on preparing the data excellent work
@programmingwithraahim
@programmingwithraahim Жыл бұрын
23:34 for those people who are getting dummy variables to be True or False, just supply (dtype=int) in the get_dummies function.
@bhumeshpanchal4904
@bhumeshpanchal4904 9 ай бұрын
thank you so much. It took my whole day to understand.
@programmingwithraahim
@programmingwithraahim 9 ай бұрын
No problem bro@@bhumeshpanchal4904
@tarangrathod255
@tarangrathod255 7 ай бұрын
thank you so much
@Piyush-yp2po
@Piyush-yp2po 3 ай бұрын
82% accuracy for exercise dataset, first remove unnecessary cols, replace col values, scale col values then train test split, then building neural network, atlast classification report, heat map and histogram plotting, thanks sir!
@manishakanojia9191
@manishakanojia9191 Ай бұрын
I really needed ANN model building video on classification model for structured dataset. Thank you for the help :)
@mrminus8590
@mrminus8590 4 ай бұрын
You have a good sense of humour I like it
@imranh2774
@imranh2774 3 жыл бұрын
Churn=Yes should be red and Churn=No should be green, however it is shown the other way around
@muditmathur465
@muditmathur465 2 жыл бұрын
Correct, proper EDA shall be done for Stakeholders to be able to understand the problem better
@tylerpoore1487
@tylerpoore1487 2 жыл бұрын
Glad I wasn't the only one who noticed this.
@parthverma7089
@parthverma7089 2 жыл бұрын
@@tylerpoore1487 nice flex
@lanreuzamere4994
@lanreuzamere4994 Жыл бұрын
@Imran H Well I think colors are compared with "Traffic Lights": Green=Go/Leave and Red=Waiting/Stay! So if you are leaving/moving(Churn=Yes) it's Green-Lights/Go and if you are Staying(Churn=No) it's Red-Lights/Wait/Stay!
@mrIndia500
@mrIndia500 10 ай бұрын
@@lanreuzamere4994 idea is good, but it would be so dumb to show customers being loyal in red flag. haha
@stevenlevittt
@stevenlevittt 2 жыл бұрын
Learnt a lot on this video. My focus mainly was on cleaning, and the part from 27:58
@ajaythapar6169
@ajaythapar6169 Жыл бұрын
Excellent order of contents delivery in a possible simple way. Made each session interesting and linked with the previous sessions. Thank you so much for your efforts.
@sauravthakur2915
@sauravthakur2915 3 жыл бұрын
Instead of using threshold value for making yp 0 and 1 we can use : yp = model.predict_classes(X_test) it will give up as 0 and 1 value.
@panther_.gaming
@panther_.gaming Жыл бұрын
wow thats some new info to me. Thanks bud. i was using round(yp,0) as it will convert all
@pei2273
@pei2273 Жыл бұрын
Thank you ! I had a hard time struggling with the coding things, but you make learning ML or DL so easy and fun!
@fahadreda3060
@fahadreda3060 4 жыл бұрын
Your videos are getting better and better, Thanks man , love your videos
@devanshsrivastava5589
@devanshsrivastava5589 4 жыл бұрын
Thanks for teaching such extensively all the projects and ML methods
@066-pritamjena3
@066-pritamjena3 8 ай бұрын
14:11 sir can you explain about that blood_sugar_men and blood_sugar_women
@lanreuzamere4994
@lanreuzamere4994 Жыл бұрын
@Imran H : Well I think colors are compared with "Traffic Lights": Green=Go/Leave and Red=Waiting/Stay! So if you are leaving/moving(Churn=Yes) it's Green-Lights/Go and if you are Staying(Churn=No) it's Red-Lights/Wait/Stay!
@shubhamsahoo331
@shubhamsahoo331 3 жыл бұрын
Thank you so much for this great tutorial, and your endless effort to share your knowledge.
@codebasics
@codebasics 3 жыл бұрын
☺️🙏
@Breaking_Bold
@Breaking_Bold Жыл бұрын
Excellent video on business use case hands-on lab !!!!
@bratsummer1980
@bratsummer1980 4 жыл бұрын
Sir you are great Your humor is also good for refresher .
@codebasics
@codebasics 4 жыл бұрын
ahh thank you :)
@ahmedosman1020
@ahmedosman1020 2 жыл бұрын
This was so good! Keep it coming!
@rishavbhattacharjee7182
@rishavbhattacharjee7182 4 жыл бұрын
Thanks for giving the dataset sir. Really helpful for practise.😁
@codebasics
@codebasics 4 жыл бұрын
Yup, practice is very important
@shrutidas3407
@shrutidas3407 6 ай бұрын
Thanks a lot sir fo making this topic sooo easy to understand🤗
@ChPradeepKumar
@ChPradeepKumar 8 ай бұрын
you have good sense of humor😂
@yashvardhan.singh3009
@yashvardhan.singh3009 2 жыл бұрын
precision recall f1-score support 0 0.96 0.87 0.91 1745 1 0.46 0.73 0.56 255 accuracy 0.85 2000 macro avg 0.71 0.80 0.74 2000 weighted avg 0.89 0.85 0.87 2000 exercise answers, 40 epochs did the work,
@zakryashakeel1883
@zakryashakeel1883 13 күн бұрын
I need help related project
@MCAAlexKumar
@MCAAlexKumar 2 жыл бұрын
Do a project to predict what type or what subject video will give you more views and engagement .
@vivekbansal1977
@vivekbansal1977 3 жыл бұрын
Yes Its Informative, Explained each and everything, Thanks Bro!
@codebasics
@codebasics 3 жыл бұрын
Glad it was helpful!
@simplydesigncad6777
@simplydesigncad6777 2 жыл бұрын
awsome tutorial . thank you for taching useful methods
@mirkhalil-c4t
@mirkhalil-c4t 3 ай бұрын
Exercise done with 86.2 testing accuracy
@Blessing-o4c
@Blessing-o4c 9 ай бұрын
i am forever grateful to you and I continuous which you success, I love that for a every questions I want to ask you provide answer like why use replace instead of one hot encode? thanx
@khanaftab3852
@khanaftab3852 3 жыл бұрын
You are a great teacher thanku
@codebasics
@codebasics 3 жыл бұрын
I am happy this was helpful to you.
@piyushpathak1996
@piyushpathak1996 4 жыл бұрын
Hello sir, First of all, love your content and teaching style. Thank you. Just wanted to clear a small doubt. Do we need to worry about the " Dummy Variable Trap" in deep learning models too? I noticed, we have not dropped any of the generated dummies after OneHot Encoding.
@bigdatamanagemententerpris8503
@bigdatamanagemententerpris8503 3 жыл бұрын
It is always good to avoid dummy variable trap.
@snehduggal3087
@snehduggal3087 4 ай бұрын
I have a question. I remember in one of the machine learning we dropped one column for the dummy variable trap. Why didn't we do it here?
@ajaykushwaha4233
@ajaykushwaha4233 3 жыл бұрын
After long search I found ANN for classification problem. Thank you for such awesome video. Sir I have a question: in ML classification we have 5-6 also for solving classification problem. Do we also have similar algo in ANN for solving multi class or binary classification problem ?
@annabiju7112
@annabiju7112 3 жыл бұрын
This was very helpful. Thanks a lot!
@KanaparthiLakshmikanth
@KanaparthiLakshmikanth Ай бұрын
Hi @25:51 i think we need to scale the features after train test split to avoid data leakage.
@letsexplorewithzak3614
@letsexplorewithzak3614 4 жыл бұрын
Your the best, when it comes to an explanation. Do you have any community where all AI, ML or deep learning talk happen?
@codebasics
@codebasics 4 жыл бұрын
Yes I am going to launch a discord community. I will announce soon, stay tuned. I will be doing a live session with some big announcements
@jaysoni7812
@jaysoni7812 3 жыл бұрын
Sir please make a video on hyper parameter tuning using keras tuner. i hardly missing your video bcz i didn't find perfect each and every component explanation at anywhere.
@adityahpatel
@adityahpatel 3 жыл бұрын
what is keras tuner?
@sandiproy330
@sandiproy330 Жыл бұрын
Thank you, sir. This was a fantastic video tutorial. Very clearly explained.
@minakshisontake3585
@minakshisontake3585 Жыл бұрын
very good knowledge
@thecomputerpilot
@thecomputerpilot Ай бұрын
GREAT video
@adhyanmaji2672
@adhyanmaji2672 4 жыл бұрын
Sir please make a video on advanced house price regression from kaggle .
@dheerajsoni9501
@dheerajsoni9501 3 жыл бұрын
Great Video.. So easy to understand Thanks alot Sir. Also I would like to learn after the model is ready, how do I run this model on other dataset. Please share your knowlegde on who to use the model on other datasets of same type.
@mehrdad_analyst
@mehrdad_analyst Жыл бұрын
That's a fantastic video. But, was there any specific reason you didn't remove one dummy variable when you used the hot-encoding method? (for preventing multicollinearity).
@Yash8147
@Yash8147 2 жыл бұрын
I got below results: precision recall f1-score support 0 0.88 0.95 0.91 1595 1 0.71 0.48 0.57 405 accuracy 0.85 2000 macro avg 0.79 0.72 0.74 2000 weighted avg 0.84 0.85 0.84 2000
@kmnm9463
@kmnm9463 4 жыл бұрын
Hi Sir, Can you please do a series on ML solutions for Anti-Money Laundering, Anomaly Detection , Market Manipulation etc. in Banking and Financial Services. I guess these are in much demand now and openings are also many. This would help a lot?. from Krish
@Sachin-xj1oq
@Sachin-xj1oq 8 ай бұрын
Hi, Wonderful lecture. If I want to use Genetic Algorithm for feature selection. How can i implement in this analysis?
@englishprimiereleague1677
@englishprimiereleague1677 2 жыл бұрын
Thanks for this wonderful video.How can I build an interface for this model
@advertisemedia1509
@advertisemedia1509 Жыл бұрын
in my case i needed to do this change (y_predicted>0.5) from sklearn.metrics import confusion_matrix , classification_report print(classification_report(y_test,y_predicted>0.5))
@work-dw2hl
@work-dw2hl 4 жыл бұрын
wonderful explanation
@codebasics
@codebasics 4 жыл бұрын
Glad it was helpful!
@nonsnona532
@nonsnona532 2 жыл бұрын
sir, thank you for this video. I have a question, how can we predict the customer churn. I mean, I want to see a way that I can give the model some information about a specific customer, then the model should give its prediction about this specific customer either yes or no churn. I asked you this question because I see you that you stopped in your video after you get the recall results. I was waiting to see you insert customer's data and get the result from the model. Thanks
@jongcheulkim7284
@jongcheulkim7284 3 жыл бұрын
Thank you.
@rajatlingwal48
@rajatlingwal48 11 ай бұрын
Thank you for making the video. Sir, I have one doubt regarding one hot encoding. When you made dummy variables and you got 3 new columns, you used all 3 new dummy colums in your model. In such scenario there would be chances of dummy variables trap or multicolliniarity. So to avoid that we always remove one colums from our dummy variables. Could you please make a separate video on it. Thank you.
@codebasics
@codebasics 11 ай бұрын
Hey yes. You can remove that column. In one of my videos in ML playlist I have discussed this
@rafibasha4145
@rafibasha4145 2 жыл бұрын
14:23,Churn=No for 120 so they are not leaving actually and from the graph its clear people are not churning due to high monthly charges
@encibimohamedhamza7182
@encibimohamedhamza7182 2 жыл бұрын
Exactly, I think it was a misinterpretation
@jishanahmed225
@jishanahmed225 2 жыл бұрын
Nice video! By the way, scaling before the train-test split caused data leakage. How can we trust the predictions then?
@jishanahmed225
@jishanahmed225 2 жыл бұрын
@@HyperLinguist-AI U need to rely on explainable machine learning tools to get what you want.
@PP-tc1zp
@PP-tc1zp 3 жыл бұрын
Hi, thank you for your courses Something different: I am tired recently I take moringa Do you know moringa and is it really healthy and safe?
@ubannadan-ekeh7781
@ubannadan-ekeh7781 4 жыл бұрын
very good tutorial, thank you. please I am getting ValueError: Must pass 2-d input, when I try to run the confusion matrix heatmap
@Sarvesh.757
@Sarvesh.757 3 жыл бұрын
use an additional bracket [ ] it will work nor
@AjinkyaBhushan
@AjinkyaBhushan 8 ай бұрын
18:30 the df1.replace('No internet service', 'No', inplace=True) is not working Can anyone suggest any help?
@AjinkyaBhushan
@AjinkyaBhushan 8 ай бұрын
I solved it here is the code: def print_unique_col_values(df1): for col in df1.columns: if df1[col].dtype == 'object': df1.loc[:, col].replace({'No internet service': 'No', 'No phone service' : 'No'}, inplace=True) print(f'{col} : {df1[col].unique()}')
@r21061991
@r21061991 4 жыл бұрын
Thankyou sir
@bratsummer1980
@bratsummer1980 4 жыл бұрын
Sir do you have any video regarding svm for various inputs?? Or Ann for more than 3 inputs?? Actually I have both classification and non classification problem
@reemaljaber
@reemaljaber 2 жыл бұрын
thanks
@sankalapajena4625
@sankalapajena4625 3 жыл бұрын
In monthly charge histogram,with a high monthly charge histogram shows that churn=no that means customers are not leaving right?but it's not true ..
@manikumar-vr3kp
@manikumar-vr3kp 3 ай бұрын
there is a problem with churn visualization colour
@raunak3406
@raunak3406 2 жыл бұрын
Hey you are using an ANN but what kind of ANN is it, like is it backpropagation, Delta, Kohonen. Which model is used here?
@techspoc7442
@techspoc7442 4 жыл бұрын
Sir , Can you make one video on keras tuner ???
@gauravakotkar3222
@gauravakotkar3222 2 жыл бұрын
Do we just build model in Random forest and ANN or we can predict value of target label by putting values of observation for which we do not know the target label. Like in Linear regression we get equation where can put value of Xs for corresponding coefficient????????
@shelidatta4885
@shelidatta4885 Жыл бұрын
My yp values are very low as compared to your values and getting errors while creating confusion matrix.Please suggest changes.
@emmanuelsamutumwa968
@emmanuelsamutumwa968 5 ай бұрын
How can I use this model in my react web application that’s has a dashboard?
@abhinavsingh-wl4yz
@abhinavsingh-wl4yz 3 жыл бұрын
What is the use of blood_sugar_men and blood_sugar_women
@dasgupts10
@dasgupts10 2 жыл бұрын
Is feature engineering a precursor to ANN unlike other deep learning techniques.Here we are doing feature engineering first then applying ANN
@itsmeatrin
@itsmeatrin Жыл бұрын
27:23 O_O dude forgot it's not time for his evil mastermind to come out LMAO
@MohamedAli-hh3qm
@MohamedAli-hh3qm 2 жыл бұрын
does this one model/dataset will suit for any type of company. I mean, This one dataset will help to predict churn for companies like bank, Telecom, Wireless Services, Food delivering services so on.
@hiteshsahoo9283
@hiteshsahoo9283 Жыл бұрын
At 18.32 The replace method is not working... Even printing the unique values there was no replacement What should be the approach to make that work??
@aaryamansingla9459
@aaryamansingla9459 3 жыл бұрын
Quick doubt: When should the scaling be done? After train_test_split or before? In this video you did it before but I heard it can lead to data leakage problem. Thank you for the content
@aliffnabil5542
@aliffnabil5542 3 жыл бұрын
yes you should scale the data after the train test split to avoid data leakage from our test split into our training split
@theyk3817
@theyk3817 2 жыл бұрын
That's your choice, but it'd be better if you scale the data set before splitting as you won't need to scale the test and validation dataset separately .
@313yogesh
@313yogesh 4 жыл бұрын
Great tutorial!, can you make a video on stock price prediction using lstm?
@codebasics
@codebasics 4 жыл бұрын
Yes I can
@cikguhasnah1418
@cikguhasnah1418 2 жыл бұрын
sir, i have train ann on my dataset and the done the preprocess stage. however, the accuracy of my ann model does not change during the epochs running. does i have problem with my dataset? tq
@dollysowmya7893
@dollysowmya7893 2 ай бұрын
I want to work on customer churn prediction but how to find the dataset for this project
@tchintchie
@tchintchie 4 жыл бұрын
thank you for the great tutorial. however there´s one question (sorry if asked before): don´t we have to take into account the obvious class imbalance of the target variable?
@codebasics
@codebasics 4 жыл бұрын
You are absolutely right that we didn't account for imbalance in the dataset. I will add a new video on how to tackle that.
@flaviobrienza6081
@flaviobrienza6081 Жыл бұрын
I have a doubt: he performed the preprocessing on the entire dataset and split it into X_train and X_test. Isn't it incorrect? Shouldn't he call the X_test X_validation, since the test set must not be pre-processed with the training set.
@hardikvegad3508
@hardikvegad3508 4 жыл бұрын
8.42 how did you removed that warning message??
@shaikansarbasha4169
@shaikansarbasha4169 3 жыл бұрын
use this code you will not get any warnings import warnings warnings.filterwarnings('ignore')
@imranuddin2153
@imranuddin2153 2 жыл бұрын
Thank you for making such wonderful step by step tutorials. I have learned more from your tutorials than from my classes. I was wondering if you'd clarify a little confusion I have. We initially saw the data had more than 7000 instances. But the confusion matrix shows lot less than that number. Shouldn't the matrix show the result for all numbers?
@LamNguyen-jp5vh
@LamNguyen-jp5vh 2 жыл бұрын
This is because he did the test split for training and testing
@RaunakKumar-yr3zv
@RaunakKumar-yr3zv Жыл бұрын
confusion matrix shows only for X_test
@stevekim1357
@stevekim1357 2 жыл бұрын
I am new to ML, how do you create 'Churn'? I only know variable values.
@techsavy5669
@techsavy5669 3 жыл бұрын
Using balanced dataset and some permutations on layers/neurons , i got ~91.3% accuracy. Is this optimal or do we have more scope here! Thanks.
@rajuvarma-zk2zw
@rajuvarma-zk2zw 4 жыл бұрын
I didn't get the point, why separately calculating precision and recall for class 0 and class1 , what is macro AVG and what is weighted average?I know generally precision and recall calculating for entire dataset . Why accuracy not considered?
@foxbat296
@foxbat296 3 жыл бұрын
Thanks for the wonderful clip..can you make a tutorial on optimizing NN using GA.. Since you explain things so nicely this will really help
@codebasics
@codebasics 3 жыл бұрын
Point noted.
@ajaykushwaha4233
@ajaykushwaha4233 3 жыл бұрын
How to know the number of hidden layers need to be built and the number of neurons in each hidden layer ?
@pyclassy
@pyclassy 4 жыл бұрын
can you upload any regression problem using ANN on skewed data without removing skewness.how we will train ANN in such case?
@humanandlifefacts9217
@humanandlifefacts9217 Жыл бұрын
the dataset has already column if a customer churned or not. Then what are we really predicting ?
@amitsaxena9122
@amitsaxena9122 4 жыл бұрын
Plz explain about NLP ,can we make a model from scratch in python .plz make a video on NLP ...thank you sir
@codebasics
@codebasics 4 жыл бұрын
yes NLP videos will be coming soon
@Codingiisgreat
@Codingiisgreat 3 жыл бұрын
at 29:35 the input_shape is (26,) that is 26 columns but what about 5625 rows ??? I'm finding input shape for this dataset quite different than the Handwriiten Digits Classification
@otsogileonalepelo9610
@otsogileonalepelo9610 3 жыл бұрын
This is the same observation I made as well, do you understand why?
@vicentemantero3007
@vicentemantero3007 3 жыл бұрын
Hello ! What is a good approach for a database that has questions in the columns and in the rows the answers to those questions (multiple selection where the clients chose 1 answer from 4 options).
@JoEl-jx7dm
@JoEl-jx7dm Жыл бұрын
Hey sir, can i use this model to predict the Hw dataset?
@shubhamvashishth8289
@shubhamvashishth8289 2 жыл бұрын
i have done exactly like you did but my total charges values are still the object type what should i do?
@Piyush-yp2po
@Piyush-yp2po 3 ай бұрын
Instead of churn yes and no, it would be easy if we would have used customers staying and leaving
@amanrohilla6659
@amanrohilla6659 7 ай бұрын
what is the end result of this prediction like kya fayda hora hai??
@muhammadkhubaib5666
@muhammadkhubaib5666 3 жыл бұрын
sir i have problem with tensorflow not working in my laptop i try my best to install.. but still face problem regarding module error not found
@digitalnomad2196
@digitalnomad2196 2 жыл бұрын
Is there a video where we can build a simple UI and deploy this project. It would good practice and making this end to end. A simple flask .api with a seirlized model. Does your channel have a video on this, thanks in advance
@codebasics
@codebasics 2 жыл бұрын
yes I have done few end to end projects. In youtube search "codebasics data science projects" you will find few playlists where I covered building UI, deployment using both fastap and flask.
@digitalnomad2196
@digitalnomad2196 2 жыл бұрын
@@codebasics Thank you, I'll check those out. What do you think a good simple deployment for this project would consist of ?
@NguyenNhan-yg4cb
@NguyenNhan-yg4cb 4 жыл бұрын
In 31:35, class y have 2 labels 1 and 0 ( mean Yes or No ), then why your final dense 1, that must be 2 right ?
@solowolf5304
@solowolf5304 3 жыл бұрын
how can we build a decision boundry for this problem
@mkacgrerg
@mkacgrerg 23 күн бұрын
all values in y_pred is 0. what to do?
Disrespect or Respect 💔❤️
00:27
Thiago Productions
Рет қаралды 40 МЛН
Happy birthday to you by Secret Vlog
00:12
Secret Vlog
Рет қаралды 6 МЛН
Real Man relocate to Remote Controlled Car 👨🏻➡️🚙🕹️ #builderc
00:24
How would a Data Scientist analyze Customer Churn?
13:04
CodeEmporium
Рет қаралды 28 М.
Tensorflow Tutorial for Python in 10 Minutes
11:33
Nicholas Renotte
Рет қаралды 461 М.
But what is a neural network? | Deep learning chapter 1
18:40
3Blue1Brown
Рет қаралды 17 МЛН
2. Case Study:  Churn Prediction
33:05
Inside Bloomberg
Рет қаралды 76 М.
ML Was Hard Until I Learned These 5 Secrets!
13:11
Boris Meinardus
Рет қаралды 339 М.