Streamlit Python Course: Build a Machine Learning App to Predict Cancer

Sdílet
Vložit
  • čas přidán 29. 07. 2024
  • Welcome to this Streamlit Python tutorial, where we will dive into creating an interactive machine-learning web application using the Streamlit framework! In this comprehensive project-based course, you'll learn how to build a machine-learning dashboard to predict whether a cell cluster is benign or malignant using Python and Streamlit. This tutorial is perfect for beginners, experienced developers, and data scientists looking to learn how to create powerful machine-learning projects that integrate with web applications.
    -----------------------
    🔥 Useful links:
    - Github project: github.com/alejandro-ao/strea...
    - Blog post: alejandro-ao.com/posts/data-s...
    💬 Join the Discord Help Server - link.alejandro-ao.com/HrFKZn
    ❤️ Buy me a coffee... or a beer (thanks): link.alejandro-ao.com/l83gNq
    ✉️ Join the mail list: link.alejandro-ao.com/AIIguB
    ------------------------
    🚀 What you'll learn in this tutorial:
    How to create a Streamlit dashboard
    Training a logistic regression model for machine learning
    Visualizing data using Plotly
    Displaying predictions based on user input
    Creating an AI full-stack app using Python
    In this video tutorial, we train a logistic regression model using machine learning in Python. We will be using a dataset to predict whether a cell cluster is benign or malignant. Once our model is ready, we will integrate it into a Streamlit application that runs in the web browser. You'll see how easy it is to create an interactive dashboard using Streamlit and Python!
    Next, we will visualize our data using Plotly to create informative and interactive charts. These visualizations will help users understand the predictions made by our machine-learning model. We'll then display the predictions based on the user's input, making our dashboard not only visually appealing but also highly functional.
    Throughout the tutorial, we'll explore various techniques and best practices used by experts like Nicholas Renotte and Patrick Loeber. This Streamlit tutorial is an excellent resource for data science dashboard projects and a great way to learn how to create a machine learning app.
    By the end of this course, you will have created an AI full-stack app using Python, Streamlit, and machine learning. You'll be ready to tackle your own machine-learning projects and create amazing data science dashboards!
    Don't forget to like, comment, and subscribe to stay updated with more tutorials and projects in machine learning, data science, and web app development!
    ⏰ Timestamps
    0:00 Intro
    2:56 Download the data
    6:23 Project setup
    8:21 Clean the data
    14:00 Train the model
    21:06 Test the model
    26:39 Export the model and scaler
    32:33 Create the Streamlit app
    38:48 Create the layout
    44:18 Add the sidebar inputs
    58:52 Create the chart
    1:17:22 Scale the values for chart
    1:25:30 Display the predictions
    1:39:08 Add custom CSS
    1:52:00 Deploy your app
    🎯 Keywords: Streamlit Python, Streamlit Tutorial, Streamlit Dashboard, Machine Learning Python, Machine Learning App Tutorial, Python App, Machine Learning Projects, Machine Learning Projects for Beginners, Nicholas Renotte, Patrick Loeber, AI App, AI Full-Stack App, Data Science Dashboard, Data Science Dashboard Projects
    #python #streamlit #MachineLearning #DataScience

Komentáře • 73

  • @alejandro_ao
    @alejandro_ao  Před 6 měsíci

    💬 Join the Discord Help Server: link.alejandro-ao.com/981ypA
    ❤ Buy me a coffee (thanks): link.alejandro-ao.com/YR8Fkw
    ✉ Join the mail list: link.alejandro-ao.com/o6TJUl

  • @Arkantosi
    @Arkantosi Před měsícem +1

    The most important with your videos are that they are easy to understand and learn, not just copy what ever you're doing. Brilliant, Alejandro! I'd love to see you doing a forecasting application using different methods (Prophet, Arima, XGBoost) and from these construct some sort of planning tool for future sales.

  • @joeg3117
    @joeg3117 Před 3 měsíci

    wow ! I will give it a try ! Big thanks to you !

  • @David-cx3fc
    @David-cx3fc Před 10 měsíci +5

    JUST FINISHED THE VIDEO AND MY APP IS DEPLOYED!! I feel so accomplished right now, learned a lot! Thank you again for walking through this entire process. I've never learned how to push things with git, so the end was very helpful. I owe you a beer and and my first paycheck when I get hired somewhere in tech lol

    • @alejandro_ao
      @alejandro_ao  Před 10 měsíci +6

      dude you are amazing, congratulations! keep it up, this was quite a complex tutorial so you’re on fire!

  • @tarnished3455
    @tarnished3455 Před rokem

    Great video! really loved it👌

  • @kevinalexis9886
    @kevinalexis9886 Před rokem +2

    Thanks for sharing!

  • @soyedafaria4672
    @soyedafaria4672 Před 5 měsíci +2

    I've successfully made my first Streamlit app, all thanks to your incredible video tutorial! 😊

    • @alejandro_ao
      @alejandro_ao  Před 4 měsíci

      it's you who are incredible ;) keep up the great work!

  • @VuNguyen-pv2lp
    @VuNguyen-pv2lp Před rokem +2

    Thanks very much for sharing it. Learning a lot from it. Really appreciate it!

  • @muhammadzakiahmad8069
    @muhammadzakiahmad8069 Před rokem +1

    Hey Alejandro Great tutorial, cleared many doubts I had. I would love to have an MLOps course from you.

  • @TheKwame83
    @TheKwame83 Před 2 měsíci

    Thank you for this great tutorial. It was fun working on it. Great job!

  • @cihan1403
    @cihan1403 Před rokem +1

    More ML tutorials please,your videos are amazing!!

  • @akhilreddy5933
    @akhilreddy5933 Před rokem

    This was awesome! Thank you.

  • @DipeshGhag-dy2qj
    @DipeshGhag-dy2qj Před 4 měsíci

    Great Video 👌.
    Loved it ❤.
    Super Informative and Detailed 💯.

  • @chikopheidris394
    @chikopheidris394 Před 8 dny

    I do appreciate your work

  • @prasadkk5948
    @prasadkk5948 Před 6 měsíci

    Bro it’s good and I loved it. Being non IT guy I’m feeling proud after building this app. Subscribed and liked it😊

    • @alejandro_ao
      @alejandro_ao  Před 6 měsíci

      Congrats mate!! This was not an easy project, you're on fire!!

  • @michaelb1099
    @michaelb1099 Před rokem

    do you have a tutorial on how to setup your data for tuning as i have a family tree text but not sure how to go about formatting and finetuning it for use like you have clean data

  • @kevinalexis9886
    @kevinalexis9886 Před rokem +3

    I like how you integrated asking ChatGPT to simplify getting the slider_labels into input_data['radius_mean'], input_data['texture_mean'], input_data['radius_mean'] etc.... I was able to get the results in a matter of seconds. I think if you include your prompting for ChatGPT in the video that might help some of the newer people

    • @alejandro_ao
      @alejandro_ao  Před rokem +1

      this is a great idea mate, i'm totally gonna be doing that!

    • @chrisyung655
      @chrisyung655 Před rokem

      @@alejandro_ao please do, would totally want to learn how you prompt chatgpt for that!

  • @chodavarapuudaykumar9204

    Hi! I enjoyed this tutorial very much. I got a warning that x does not have valid feature names, but standardscaler was fitted with feature names how to rectify this.

  • @junaidlatif2881
    @junaidlatif2881 Před 8 měsíci

    Love you bro

  • @Javier-rc2zh
    @Javier-rc2zh Před rokem

    Thank you very much for the course

  • @rajputup1531
    @rajputup1531 Před rokem +3

    really loved it brother, if possible, can you make this type of video frequently.

    • @alejandro_ao
      @alejandro_ao  Před rokem +4

      thanks! of course, i'll be making more AI and LLM applications here :)

    • @yuvrajthakur143thakur3
      @yuvrajthakur143thakur3 Před 5 měsíci

      From where we can get those labels 😢 tell me

  • @rickkenny5342
    @rickkenny5342 Před 7 měsíci +1

    Thanks!

    • @alejandro_ao
      @alejandro_ao  Před 6 měsíci

      you are amazing, thank you so much! i'll keep posting videos about ML

  • @pennadasaieshwar
    @pennadasaieshwar Před 8 měsíci

    bro how to add background image as a custome image is it possible to change by using this css in streamlit

  • @muniswamivikram
    @muniswamivikram Před 4 dny

    Big Thanks to you bro

  • @dipayanbhowal7025
    @dipayanbhowal7025 Před 2 měsíci

    Hey ale i need a help from you. i am keeping my data_clean model and createmodel as sepreate py files in model folder. i didnt wanna write the clean_data function in the app/main file but just wanted to import it but there is major path issue i am facing

  • @jesusmunzon1336
    @jesusmunzon1336 Před 24 dny

    Enhorabuena Alejandro por el trabajo!! He seguido paso por paso tu video, cuando modifico valores en el terminal de vs code me aparece siempre este warning: X does not have valid feature names, but StandardScaler was fitted with feature names. ¿A que se puede deber esta advertencia?

  • @RaihanRisad
    @RaihanRisad Před 3 měsíci

    I have a quesiton, why are importing pickle5, as far as i know after python 3.8 and newer pickle does all the things that pickle5 or other versions used to do

  • @mr_noob6361
    @mr_noob6361 Před rokem

    st.write("Probability of Benign:- ",model.predict_proba(scaled_array)[0][0])
    st.write("Probability of Maligant:- ",model.predict_proba(scaled_array)[0][1]) bro this line.does it says that we need to remember? as like for 2 cases this is the condition. if suppose we have 3 class the we need to write [0][2](for last one)

  • @DemoGPT
    @DemoGPT Před 11 měsíci

    I'm loving this video - thanks for all your hard work. Are there any plans for a video about DemoGPT?

  • @Chasingaxl
    @Chasingaxl Před rokem

    I am going to try this with sports data.

    • @s0ulweaver
      @s0ulweaver Před rokem +1

      I'm going to try this with stocks data! It's really amazing how he has taught and we can do our own variations for topic of our interests and then change theme, title and sidebar parameters and it's a whole unique project!

  • @sara_zeus
    @sara_zeus Před 7 měsíci

    I love you! ❤

  • @TrollDaQA
    @TrollDaQA Před 5 měsíci +3

    You should be careful with data leakage, shouldn't you? That is, you should first split into train and test sets and only then perform a fit_transform on the training data and a transform on the test data.

  • @alejandro_ao
    @alejandro_ao  Před rokem +4

    subscribe for more! :)

    • @kayre1788
      @kayre1788 Před 8 měsíci +1

      Gooday awesome video
      Is there like a pdf format for this project explaining how it works

  • @nazk561
    @nazk561 Před 7 měsíci

    If I wanted to create something similar for thymoma cancer would this be a good foundation?

    • @nazk561
      @nazk561 Před 7 měsíci

      Or would I need to use a completely different model. I’m new to machine learning and a computer science student at a university. Thanks!

  • @kevinalexis9886
    @kevinalexis9886 Před rokem +3

    Also not sure if it's mentioned but at around the 31:00 min mark I had an issue with Pickle5 and I needed to "import pickle" instead of "import pickle5 as pickle". Hope this helps someone with this error!

    • @alejandro_ao
      @alejandro_ao  Před rokem

      interesting. maybe you did `pip install pickle` instead of `pip install pickle5`? they are both the same library, but pickle5 is supposed to be the most recent one

    • @python360
      @python360 Před rokem +1

      @@alejandro_ao I had same issue as @kevinalexis9886 and was using Python 3.11.3 so I just changed it to "import pickle" as well and it works! 👍👍

    • @madcity2073
      @madcity2073 Před 6 měsíci

      ​@@alejandro_aoI did have the same error aswell but could not install pickle5 neither, the only way it worked was without pickle5

  • @osamadammag6303
    @osamadammag6303 Před 6 měsíci

    I hope you well alejandro,
    I have a question ⁉️ which problem this project solve !!
    Thanks 🙏🏻

    • @alejandro_ao
      @alejandro_ao  Před 6 měsíci

      hey there, this is mainly for educational purposes, but a more capable version of this would be able to make an oncologist's job way easier by allowing them to know beforehand if a tumor has a high probability of being malignant

  • @rohanshinde3096
    @rohanshinde3096 Před 24 dny

    accuracy ?

  • @muhammedabnas2894
    @muhammedabnas2894 Před 2 měsíci

    where can i see the logistic regression video mentioned here??
    please share me the link

    • @alejandro_ao
      @alejandro_ao  Před 2 měsíci

      here you go: Logistic Regression Project: Cancer Prediction with Python
      czcams.com/video/My4JgIeFdWk/video.html

  • @lokeshart3340
    @lokeshart3340 Před rokem

    input_data['radius_mean'],
    ~~~~~~~~~~^^^^^^^^^^^^^^^
    TypeError: 'builtin_function_or_method' object is not subscriptable
    pls solve this error

  • @ko-prometheus
    @ko-prometheus Před rokem

    Dude, what does this software design of yours do?

  • @madcity2073
    @madcity2073 Před 6 měsíci

    18:23 why test_size 20% and random_state = 42? please elaborate to understand the logic

    • @alejandro_ao
      @alejandro_ao  Před 6 měsíci +3

      good question!
      About the test size:
      so when you partition your data, you are creating a training set and a testing set. you train your model on the training set, and test it on the testing set (which contains data that your trained model has never seen before). in this example, I set the test sample to 20%, but some people set it to 30%. the idea is to make your training set as large as possible, while leaving enough data to test it on.
      About the random state:
      this can be any number you like. this number is useful because it allows you to replicate your random split. in other words, the "random" split will be the same every time you run this code as long as you have chosen the same random state. so, since this number can be anything you want, nerds just started writing 42 every time because it is the answer to life, the universe and everything 👉 www.google.com/search?q=the+answer+to+life+the+universe+and+everything

  • @chunman6735
    @chunman6735 Před 6 měsíci

    did you have any web scrap project?
    i think this is my weakness🤣

    • @alejandro_ao
      @alejandro_ao  Před 5 měsíci

      i haven't uploaded any about scraping in detail! but if that's your weakness, you may want to check octoparse :) it's literally the easiest way i have ever seen to scrape a website and you don't need to code it