Build A Machine Learning Web App From Scratch

  Рет қаралды 198,673

Patrick Loeber

Patrick Loeber

Күн бұрын

Build a Machine Learning web application from scratch in Python with Streamlit. We use real world data to build a machine learning model. In the first part you learn how we analyze the data and build our model, and in the second part we build the web app using streamlit.
Get my Free NumPy Handbook:
www.python-engineer.com/numpy...
✅ Write cleaner code with Sourcery, instant refactoring suggestions in VS Code & PyCharm: sourcery.ai/?... *
⭐ Join Our Discord : / discord
📓 ML Notebooks available on Patreon:
/ patrickloeber
If you enjoyed this video, please subscribe to the channel:
▶️ : / @patloeber
Code: github.com/patrickloeber/ml-a...
Resources:
Streamlit: streamlit.io/
Stack Overflow Survey Data:
insights.stackoverflow.com/su...
insights.stackoverflow.com/su...
Anaconda Tutorial: • Anaconda Tutorial - In...
~~~~~~~~~~~~~~~ CONNECT ~~~~~~~~~~~~~~~
🖥️ Website: www.python-engineer.com
🐦 Twitter - / patloeber
✉️ Newsletter - www.python-engineer.com/newsl...
📸 Instagram - / patloeber
🦾 Discord: / discord
▶️ Subscribe: / @patloeber
~~~~~~~~~~~~~~ SUPPORT ME ~~~~~~~~~~~~~~
🅿 Patreon - / patrickloeber
#Python
pandas scikit-learn numpy streamlit sklearn
Timeline:
00:00 - Introduction
00:39 - Project Overview
04:48 - Data Cleaning & Model
30:55 - Build The Web Application
----------------------------------------------------------------------------------------------------------
* This is an affiliate link. By clicking on it you will not have any additional costs, instead you will support me and my project. Thank you so much for the support! 🙏

Пікірлер: 214
@patloeber
@patloeber 3 жыл бұрын
If you follow this tutorial you have a great portfolio project for your resume: It shows working with real world data and putting it into a ML web app that visualizes the results. Hope you enjoy it :)
@MrAntivirus66
@MrAntivirus66 3 жыл бұрын
Hello Patrick, you are treally amazing.. i do have faculty project that i cant solve. that is face recognition using CNN's, and integrating it into django web app,, i am ''junior'' so it is really big step for me.. so if you could help with anything it would be great.. Ty kind sir :)
@prajwalbagchi3965
@prajwalbagchi3965 2 жыл бұрын
I am unable to solve an error in the 78th code box of your jupytor notebook which gives me the error:- first line:-"y contains previously unseen labels: 'United States" " 2nd line:- " y contains previously unseen labels: '2' " . I am unable to find a solution to this error, it would be of great help if anyone could guide me. THANKS😊
@Saffron_SV
@Saffron_SV Жыл бұрын
@@prajwalbagchi3965 check the label must be changed to 'United States of America'... and for checking write this code df["Country'].unique()
@ganeshchowdhary7479
@ganeshchowdhary7479 6 ай бұрын
​​@patloeber hello sir I need to ask u some thing in the 10th cell what is the use of filtering the Employment column if ur gonna drop it in the next line it self 🤔 12:36
@comfortrwuaan
@comfortrwuaan 3 ай бұрын
​@Saffron_SV Thank you for this, I was also stuck here for days
@gabrielalopezgutierrez8871
@gabrielalopezgutierrez8871 Жыл бұрын
This is exactly what you are looking for if you are a junior data scientist who just started a web app project. Incredibly simple and yet complex intro.
@Mike-jr7re
@Mike-jr7re 2 жыл бұрын
What a maestro! Keep your great work, man. Really appreciate this high quality stuff!
@yevg3907
@yevg3907 2 жыл бұрын
As I said previously I was probably within your first 1k subscribers and man I just love watching you go at these in the zone! Great content relevant no fluff just keep going love it
@shishirrd
@shishirrd 2 жыл бұрын
This was fantastic! I built my first Python web app using exclusively this tutorial. Thank you, Python Engineer.
@patloeber
@patloeber 2 жыл бұрын
Great to hear!
@yarlagaddaharish8137
@yarlagaddaharish8137 2 жыл бұрын
hey what should I include in .pkl file?
@mdjisanahmed4310
@mdjisanahmed4310 8 ай бұрын
@@patloeber Is this annual salary?
@ganeshchowdhary7479
@ganeshchowdhary7479 6 ай бұрын
​@@patloeber hello sir I need to ask u some thing in the 10th cell what is the use of filtering the Employment column if ur gonna drop it in the next line it self 🤔 12:36
@ganeshchowdhary7479
@ganeshchowdhary7479 6 ай бұрын
​@@patloeber​​ hello sir I need to ask u some thing in the 10th cell what is the use of filtering the Employment column if ur gonna drop it in the next line it self 🤔 12:36
@AhmadIHafez
@AhmadIHafez 2 жыл бұрын
Thanks a lot it was detailed enough to help!
@raymondmichael4987
@raymondmichael4987 2 жыл бұрын
I'll come to this, your teaching made me think about starting to learn streamlit
@prettiestthing
@prettiestthing 2 жыл бұрын
This was amazing!! Thanks for this tutorial, loved it
@moviesaddahindimovies2963
@moviesaddahindimovies2963 2 жыл бұрын
No such file or directory: 'saved_steps.pkl' please help
@tecnom7133
@tecnom7133 4 ай бұрын
Thanks man , waiting for more
@tinylittleanj2
@tinylittleanj2 2 жыл бұрын
This is amazing! Thanks for sharing
@aikeshakeutayeva8828
@aikeshakeutayeva8828 Жыл бұрын
Thank you! That was interesting 💯
@sulekhamohamud9085
@sulekhamohamud9085 Жыл бұрын
Thank you,this project actually works.Much appreciationn😇
@peterodesola5056
@peterodesola5056 Жыл бұрын
i really enjoy the tutorial, thanks sir.
@NePhoosStAr
@NePhoosStAr Жыл бұрын
Omg thanks you soo soo so much, because I was in college try Harding to understand the concept of machine learning. Got to learn so much. Like the concept of : data cleansing, data training fitting, how to use trained AI to make prediction. Your explanation is just mind blowing. I did this project and on top added my own touch which I would've never done if were to just to try to learn from College alone.
@robertoespinoza199
@robertoespinoza199 3 жыл бұрын
Amazing video bro!!!! Thanks so much for sharing your knowledge
@patloeber
@patloeber 3 жыл бұрын
thanks a lot :)
@perceptron5983
@perceptron5983 3 жыл бұрын
Cool. Added to my watchlist.
@kevinalexis9886
@kevinalexis9886 2 жыл бұрын
Thanks, this was very helpful!
@chouchanewifak4351
@chouchanewifak4351 2 жыл бұрын
can you tell me why this is incorrect ?? X[:, 0] = le_country.transform(X[:,0]) X[:, 1] = le_education.transform(X[:,1]) X = X.astype(float) X
@camilalissetsaenzvelasquez3981
@camilalissetsaenzvelasquez3981 Жыл бұрын
this is awesome! Thank you
@gianlucavannoli2698
@gianlucavannoli2698 2 жыл бұрын
such a good video. Thanks for sharing bro
@kevinmeyer3863
@kevinmeyer3863 3 жыл бұрын
Great material! Would you mind making a future video on other data preprocessing/cleaning techniques? Would be great to systematize an approach.
@patloeber
@patloeber 3 жыл бұрын
yeah I want to do this in the future
@sujithrasankar3438
@sujithrasankar3438 2 жыл бұрын
Awesome tutorial!!
@gingerdragon6216
@gingerdragon6216 2 жыл бұрын
What an awesome tutorial.
@m-adem
@m-adem 2 жыл бұрын
Thank You 🙌 You Are My Hero 💖
@antonietakuz5636
@antonietakuz5636 6 ай бұрын
@Patrick Loeber Hola!!! :) greetings from Argentina, excellent video and explanation, please continue doing them
@faisalsaddique3323
@faisalsaddique3323 2 жыл бұрын
THANK YOU SO MUCH SIR!
@sadie-je4dl
@sadie-je4dl 4 ай бұрын
Awesome explanation.
@lb9774
@lb9774 3 жыл бұрын
Huge perfect and get new skill . Thank you.
@patloeber
@patloeber 3 жыл бұрын
glad you like it
@saurrav3801
@saurrav3801 3 жыл бұрын
It's nice to see you in this video bro......nice video too..bro..keep going 🔥🔥🔥
@patloeber
@patloeber 3 жыл бұрын
thanks :)
@jaggyjut
@jaggyjut 3 жыл бұрын
This is awesome. Could you create a tutorial on how to build a web app which can identify an image deployed on google cloud. One of the best ML channels. Pure Gold.
@patloeber
@patloeber 3 жыл бұрын
Thanks! Watch my latest tutorial, it's about Google Cloud deployment ;)
@luckychitundu1070
@luckychitundu1070 Жыл бұрын
Great work
@siddharthgawande1799
@siddharthgawande1799 2 жыл бұрын
Really awesome tutorial Thanks for this one, it helped a lot
@shilpikumari4368
@shilpikumari4368 Жыл бұрын
Hello
@shilpikumari4368
@shilpikumari4368 Жыл бұрын
have you made this project ??
@siddharthgawande1799
@siddharthgawande1799 Жыл бұрын
Yep
@blogactivities5462
@blogactivities5462 Ай бұрын
thank you Patrick
@DeepFrydTurd
@DeepFrydTurd 2 жыл бұрын
Awesome content 🙂👍
@azrflourish9032
@azrflourish9032 2 жыл бұрын
WOOOOOOOOOOOWWWWWWWWWWWWWWWWWWWWWW!!!!!!!! YOU ARE GREAT! STREAMLIT ALSO AWESOME! IT MAKES EASIER TO LIVE :D
@sriharishpopuri2821
@sriharishpopuri2821 3 жыл бұрын
This is a helpful tutorial. Thank you. Can you also make a video on Interactions between different charts using streamlit? This will be useful to many(like me) I guess👍🏻
@patloeber
@patloeber 3 жыл бұрын
i'll have a look at it
@jaxsamir3252
@jaxsamir3252 3 жыл бұрын
You prolly dont care but if you are bored like me atm then you can watch all of the latest movies on InstaFlixxer. Have been watching with my gf during the lockdown :)
@lucasxavier8072
@lucasxavier8072 3 жыл бұрын
@Jax Samir yea, been using instaflixxer for since november myself =)
@jackreacher5257
@jackreacher5257 3 жыл бұрын
Thank you
@chineduezeofor2481
@chineduezeofor2481 3 жыл бұрын
Excellent video!!!
@patloeber
@patloeber 3 жыл бұрын
Glad you liked it!
@Bianchi77
@Bianchi77 3 жыл бұрын
Nice video, thanks :)
@patloeber
@patloeber 3 жыл бұрын
Glad you like it
@kaushekravi2901
@kaushekravi2901 2 жыл бұрын
Hi! Shouldn't the label encoder transformers need to be used only in the target variables? But in this video you are using it for the input variables too. Correct me if I'm wrong.
@dhirajmohite5693
@dhirajmohite5693 11 ай бұрын
Fantastic video
@philtoa334
@philtoa334 3 жыл бұрын
Really good project.
@patloeber
@patloeber 3 жыл бұрын
Glad you like it
@mikiallen7733
@mikiallen7733 Жыл бұрын
Great tutorial, however in which step shall I add a streaming source datasets instead of the static one which you have presented here ? Best
@ashanbandaranayeke9344
@ashanbandaranayeke9344 2 ай бұрын
Thanks Patrick! Was a lovely tutorial and guessing the frame can be used to design other linear regression apps easily (and other models with a little bit of work).
@Sece1
@Sece1 2 жыл бұрын
Great video! Can you explain from where you saved the pickle file and deployed the model? I am trying with 14 variables but I dont want to make prediction using all of them. How would that be possible?
@Jimbob2k
@Jimbob2k 2 жыл бұрын
Great tut and great accent
@CodeWithTomi
@CodeWithTomi 3 жыл бұрын
Niceee... web dev with ML
@patloeber
@patloeber 3 жыл бұрын
Yep great combination :) Maybe one day I'll make a Django+ML project
@CodeWithTomi
@CodeWithTomi 3 жыл бұрын
@@patloeber that'll be great!
@hardikrab
@hardikrab 2 жыл бұрын
This is amazing!!
@patloeber
@patloeber 2 жыл бұрын
thank you!
@nishanttiwari9736
@nishanttiwari9736 2 жыл бұрын
Great Video
@adityaariewijaya9284
@adityaariewijaya9284 2 жыл бұрын
I like the way you set up the iterm2. Can you make a video how you set up that?
@patloeber
@patloeber 2 жыл бұрын
I pretty much followed this article: opensource.com/article/20/8/iterm2-zsh
@briankoech4307
@briankoech4307 2 жыл бұрын
Thank you very much. I learnt a lot following this tutorial. You are amazing.
@patloeber
@patloeber 2 жыл бұрын
glad it was helpful!
@rangabharath4253
@rangabharath4253 3 жыл бұрын
awesome as always :-)
@patloeber
@patloeber 3 жыл бұрын
Thanks :)
@Sidhubaba
@Sidhubaba 4 ай бұрын
Awesome !
@adeshmishra1671
@adeshmishra1671 3 жыл бұрын
We want more videos like this..plzzz
@patloeber
@patloeber 3 жыл бұрын
sure :)
@adeshmishra1671
@adeshmishra1671 3 жыл бұрын
@@patloeber thank u sir🙏
@dubglass
@dubglass 2 жыл бұрын
Great material! What could be done to achieve a lower error ? That one obtained seems too big, don’t you think?
@patloeber
@patloeber 2 жыл бұрын
yeah it's not optimal, you can try different features, feature selection methods, normalization etc...and of course different models and optimize the hyperparameters
@rololop34
@rololop34 2 жыл бұрын
magnificent!
@_rupeshchauhan
@_rupeshchauhan 2 жыл бұрын
Awesome Can you please make more videos on it. It's a request.
@patloeber
@patloeber 2 жыл бұрын
thanks for the feedback! I try :)
@mohammedarmash8841
@mohammedarmash8841 11 ай бұрын
@patloeber, what if do the label encoding in for loop ,what should i do after importing the model
@ahmedhelal920
@ahmedhelal920 2 жыл бұрын
Really thanks for this project , i have question please , on sidebar explore and predict the visualizations appeared on both of them . How can i solve that .
@elad3958
@elad3958 Жыл бұрын
PERFECT!
@rog0079
@rog0079 3 жыл бұрын
You're a Gem !
@patloeber
@patloeber 3 жыл бұрын
Thanks :)
@sushantgautam5535
@sushantgautam5535 Жыл бұрын
Great! Looking for more like this. Thanks.
@patloeber
@patloeber Жыл бұрын
Glad you liked it!
@wilsongomes3360
@wilsongomes3360 2 жыл бұрын
A truly masterpeace
@taheralipatrawala7300
@taheralipatrawala7300 2 жыл бұрын
How do we change the styling and structure of the web application as in HTML and CSS?
@jayshworkhadka8406
@jayshworkhadka8406 2 жыл бұрын
you used label encoder and gave that value, but what if we did one hot encoding, then how will we implement that in streamlit ?
@karthikb.s.k.4486
@karthikb.s.k.4486 3 жыл бұрын
Nice can you also do interaction of FAST API with streamlit for this ML problem. Thank you
@patloeber
@patloeber 3 жыл бұрын
Yeah FastAPI is on my list
@perceptron5983
@perceptron5983 3 жыл бұрын
I second that. 😀
@yevg3907
@yevg3907 3 жыл бұрын
Nice
@crabosity
@crabosity 2 жыл бұрын
Even after using terminal to install scikit learn jupyter does not detect it and says no module named sklearn?
@adityasahu96
@adityasahu96 2 жыл бұрын
Can you make a video on how to make front end using react instead of streamlit . Thanks
@Dark-kj2fz
@Dark-kj2fz 2 жыл бұрын
Hellooo Sir, very nice tutorial. But how can we make it accessible to everyone (sort of url or website) not a localhost ? Thanks in advance and keep it up !!
@divyansxii-b1677
@divyansxii-b1677 Күн бұрын
which type of dataset is this? supervised or non - supervised or semi supervised?
@lightkira8281
@lightkira8281 2 жыл бұрын
شكرا لك
@techcompany_
@techcompany_ 4 ай бұрын
How we can calculate accuracy of above project??
@fahadshaikh9099
@fahadshaikh9099 Жыл бұрын
whenever i try to import streamlit as st it always shows error stating "import streamlit could not be resolvedpylancereportmissingimports" any idea what the issue can be? should i open vs code from the comman prompt that im using conda for ?
@moeeztahir208
@moeeztahir208 2 жыл бұрын
Hello Sir, I had face a problem during practice regressor problem. I don't understand how to solve a problem ! (regressor is not defined)
@frankkoslowski6917
@frankkoslowski6917 2 жыл бұрын
from sklearn import linear_model linear_reg = linear_model.LinearRegression()
@adil288
@adil288 Жыл бұрын
I am trying to deploy on streamlit cloud but throwing some weird error I guess I am using wrong versions in requirements.txt.Kindly let me know which version to be installed
@tamirtsogbayar3912
@tamirtsogbayar3912 3 жыл бұрын
Thank you so much can you do fingerprint matching web ?
@patloeber
@patloeber 3 жыл бұрын
Will have a look at this
@tamirtsogbayar3912
@tamirtsogbayar3912 3 жыл бұрын
@@patloeber thank you so much
@placidaorlunwo5012
@placidaorlunwo5012 Жыл бұрын
I have three categorical data types and my confusion is on how to implement them given that this section of the code has just a two-dimensional array. ok = st.button("Calculate Salary") if ok: X = np.array([[country, education, expericence ]]) X[:, 0] = le_country.transform(X[:,0]) X[:, 1] = le_education.transform(X[:,1]) X = X.astype(float)
@mavinii960
@mavinii960 3 ай бұрын
This is related to the `LabelEncoder`: # Your DataFrame processing should look like this: le_education = LabelEncoder() df['EdLevel'] = le_education.fit_transform(df['EdLevel']) le_country = LabelEncoder() df['Country'] = le_country.fit_transform(df['Country']) # Prepare your feature matrix `X` and target vector `y` X = df.drop("Salary", axis=1) y = df["Salary"] Then you can go ahead and follow him at 21:42. Quick reminder that I am using a dataset from 2023, so in my Decision Tree Regressor, I needed to change the "United States of America" it is like: # Correct the country and education level based on how they were encoded new_data = [["United States of America", "Master’s degree", 15]] # Create a DataFrame for the new data point for easy manipulation new_data_df = pd.DataFrame(new_data, columns=["Country", "EdLevel", "YearsCodePro"]) # Apply the trained LabelEncoders to the new data new_data_df['Country'] = le_country.transform(new_data_df['Country']) new_data_df['EdLevel'] = le_education.transform(new_data_df['EdLevel']) # Ensure all data is in the correct numeric format new_data_df = new_data_df.astype(float) I hope it helps.
@courageiroro5604
@courageiroro5604 2 жыл бұрын
Can we consider this prediction as Real Time prediction?
@syaduinotech3681
@syaduinotech3681 11 ай бұрын
Thanks sir. Can you share the video how to published this kind of local data into github/ webapps that can be use by anyone in the world as apps/ web gui.
@nyotowijaya7949
@nyotowijaya7949 2 жыл бұрын
You're the best
@harshitpawar9038
@harshitpawar9038 Жыл бұрын
I can't understand one thing, how did you select those columns without any correlation?
@necbranduc
@necbranduc 2 жыл бұрын
How well will this scale?
@rengimcetingoz4740
@rengimcetingoz4740 2 жыл бұрын
KING 👑
@sireode
@sireode Ай бұрын
When I recreated this app, when I predict based on Bachelor’s degree, the salary predicts well. But when I predict based on "Post grad " select, the salary prediction is not accurate. On zero experience, i get a a higher salary than when I have one year experience. This also applicable to the other selections. Only Bachelor’s degree select predicts well. Is this as a result of the outlier?
@neotank874
@neotank874 2 жыл бұрын
I ran into a problem. After creating the drop-down, whenever I select a list, the whole entire thing disappears.
@openeyesvo8550
@openeyesvo8550 2 жыл бұрын
can we build a ML project using jupyter Notebook? if yes how can i deploye on web app?
@rahulpurashtu8904
@rahulpurashtu8904 29 күн бұрын
Why you used label encoder for country column ?. I think we have to use one hot encoder because it is nominal data.
@erictovbin4200
@erictovbin4200 3 жыл бұрын
Ich kann nur danke sagen!
@patloeber
@patloeber 3 жыл бұрын
Gerne :)
@pushkarprabhat3300
@pushkarprabhat3300 2 ай бұрын
Hey @Patrick Loeber can you provide the dataset of this project???
@josephmargaryan
@josephmargaryan Жыл бұрын
How do we deploy the data so we can share it publicly with everybody
@shubhampatrick
@shubhampatrick 3 жыл бұрын
I like this
@shashikawiley6515
@shashikawiley6515 2 жыл бұрын
What is the technique used here is it classification/clustering or any other technique
@patloeber
@patloeber 2 жыл бұрын
Regression
@nikhilkshirsagar3995
@nikhilkshirsagar3995 2 жыл бұрын
sir u haven't given the pkl file?
@datainnovators1883
@datainnovators1883 7 ай бұрын
where we collect the data set
@shivagowrireddy139
@shivagowrireddy139 2 жыл бұрын
data = pickle.load(file) _pickle.UnpicklingError: invalid load key, '?'. can anyone help me out with this error?
@sonyvishwakarma9821
@sonyvishwakarma9821 2 жыл бұрын
how to create a conda environment?
@YASHPRASAD_
@YASHPRASAD_ 2 жыл бұрын
Hey PE, I'm getting this error while installing the kernal in my virtual environment: "ipython: error: argument --user: expected one argument in anaconda" .................can you suggest/help how to solve this?
@mohamedbarakat9908
@mohamedbarakat9908 Жыл бұрын
you should write " kernel " insted of " kernal " , it's a syntax error
@ashishm2974
@ashishm2974 2 жыл бұрын
How to use machine learning model (pickle / jooblib ) and make Graphs and log in /register and house price Prediction in django
@hayki_ds
@hayki_ds 11 ай бұрын
is it possible to send the link someone? or it's working only local?
@nishitbohra943
@nishitbohra943 2 жыл бұрын
can you tell me which machine learning algorithm is used in this code
@patloeber
@patloeber 2 жыл бұрын
LinearRegression and RandomForestRegressor
@nishitbohra943
@nishitbohra943 2 жыл бұрын
@@patloeber thank you so much can u tell me specifically where each is used
Python Machine Learning Tutorial (Data Science)
49:43
Programming with Mosh
Рет қаралды 2,7 МЛН
Streamlit Elements You Should Know About in 2023
14:31
Mısra Turp
Рет қаралды 87 М.
small vs big hoop #tiktok
00:12
Анастасия Тарасова
Рет қаралды 14 МЛН
Is it Cake or Fake ? 🍰
00:53
A4
Рет қаралды 19 МЛН
I Analyzed My Finance With Local LLMs
17:51
Thu Vu data analytics
Рет қаралды 423 М.
ML Was Hard Until I Learned These 5 Secrets!
13:11
Boris Meinardus
Рет қаралды 212 М.
Streamlit: The Fastest Way To Build Python Apps?
11:57
pixegami
Рет қаралды 70 М.
How ChatGPT Built My App in Minutes 🤯
8:28
Website Learners
Рет қаралды 2 МЛН
How I’d learn ML in 2024 (if I could start over)
7:05
Boris Meinardus
Рет қаралды 929 М.
The Harsh Reality of Being a Data Analyst
7:39
Sundas Khalid
Рет қаралды 548 М.
Why Does Scrum Make Programmers HATE Coding?
16:14
Thriving Technologist
Рет қаралды 494 М.
I tried building a AUTO MACHINE LEARNING Web App 15 Minutes
24:07
Nicholas Renotte
Рет қаралды 79 М.
Build 12 Data Science Apps with Python and Streamlit - Full Course
3:11:52
freeCodeCamp.org
Рет қаралды 1,2 МЛН
Transport Layer Security (TLS) - Computerphile
15:33
Computerphile
Рет қаралды 469 М.
small vs big hoop #tiktok
00:12
Анастасия Тарасова
Рет қаралды 14 МЛН