{"id":10378,"date":"2020-10-15T10:25:35","date_gmt":"2020-10-15T10:25:35","guid":{"rendered":"https:\/\/www.experfy.com\/blog\/?p=10378"},"modified":"2023-10-20T17:31:48","modified_gmt":"2023-10-20T17:31:48","slug":"how-build-simple-machine-learning-web-app-python-part-2","status":"publish","type":"post","link":"https:\/\/www.experfy.com\/blog\/bigdata-cloud\/how-build-simple-machine-learning-web-app-python-part-2\/","title":{"rendered":"How to Build a Simple Machine Learning Web App in Python \u2013Part 2"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"10378\" class=\"elementor elementor-10378\" data-elementor-post-type=\"post\">\n\t\t\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-5e22f7ba elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5e22f7ba\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-7be394f6\" data-id=\"7be394f6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-0ddef1e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"0ddef1e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ae85a96\" data-id=\"ae85a96\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b0cb05a elementor-widget elementor-widget-text-editor\" data-id=\"b0cb05a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tIn this article, I will show you how to build a simple machine learning powered data science web app in Python using the streamlit library in less than 50 lines of code.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-890b404 elementor-widget elementor-widget-text-editor\" data-id=\"890b404\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<em>(Quick Note: You might also want to check out\u00a0<\/em><a href=\"http:\/\/www.experfy.com\/blog\/bigdata-cloud\/how-to-build-a-data-science-web-app-in-python\/\" target=\"_blank\" rel=\"noreferrer noopener\"><strong><em>Part 1<\/em><\/strong><\/a><em>\u00a0of this streamlit tutorial series on building your first web app. Shoutout to\u00a0<\/em><a href=\"https:\/\/medium.com\/@smutama\" target=\"_blank\" rel=\"noreferrer noopener\" class=\"broken_link\"><em>Simon<\/em><\/a><em>\u00a0for suggesting the mention of Part 1.)<\/em><\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-07ca419 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"07ca419\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-0aa7078\" data-id=\"0aa7078\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-3d27f3c elementor-widget elementor-widget-text-editor\" data-id=\"3d27f3c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tThe data science life cycle is essentially comprised of data collection, data cleaning, exploratory data analysis, model building and model deployment. For more information, please check out the excellent video by\u00a0<a href=\"https:\/\/www.youtube.com\/channel\/UCiT9RITQ9PW6BhXK0y2jaeg\" target=\"_blank\" rel=\"noreferrer noopener\">Ken Jee\u00a0<\/a>on\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=BZFfNwj7JhE\" target=\"_blank\" rel=\"noreferrer noopener\"><em>Different Data Science Roles Explained (by a Data Scientist)<\/em><\/a>. A summary infographic of this life cycle is shown below:\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-feabd2a elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"feabd2a\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b9ebecf\" data-id=\"b9ebecf\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a63cabf elementor-widget elementor-widget-image\" data-id=\"a63cabf\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/1964\/1*45hojOwMLRL86TA1ISQfJA.jpeg\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-9e97a58 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9e97a58\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-364613c\" data-id=\"364613c\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-977039d elementor-widget elementor-widget-text-editor\" data-id=\"977039d\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tAs a Data Scientist or Machine Learning Engineer, it is extremely important to be able to deploy our data science project as this would help to complete the data science life cycle. Traditional deployment of machine learning models with established framework such as Django or Flask may be a daunting and\/or time-consuming task.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-a6bcca2 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a6bcca2\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4d12fb9\" data-id=\"4d12fb9\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9ca5fc4 elementor-widget elementor-widget-text-editor\" data-id=\"9ca5fc4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tThis article is based on a video that I made on the same topic on the\u00a0<a href=\"https:\/\/www.youtube.com\/dataprofessor?sub_confirmation=1\" target=\"_blank\" rel=\"noreferrer noopener\">Data Professor YouTube channel<\/a>\u00a0(<a href=\"https:\/\/www.youtube.com\/watch?v=8M20LyCZDOY\" target=\"_blank\" rel=\"noreferrer noopener\">How to Build a Simple Machine Learning Web App in Python<\/a>) in which you can watch it alongside reading this article.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-6475a8b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"6475a8b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1c290bf\" data-id=\"1c290bf\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-74d9e37 elementor-widget elementor-widget-video\" data-id=\"74d9e37\" data-element_type=\"widget\" data-e-type=\"widget\" data-settings=\"{&quot;youtube_url&quot;:&quot;https:\\\/\\\/www.youtube.com\\\/watch?v=8M20LyCZDOY&quot;,&quot;video_type&quot;:&quot;youtube&quot;,&quot;controls&quot;:&quot;yes&quot;}\" data-widget_type=\"video.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<div class=\"elementor-wrapper elementor-open-inline\">\n\t\t\t<div class=\"elementor-video\"><\/div>\t\t<\/div>\n\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-c33c621 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"c33c621\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-5a89812\" data-id=\"5a89812\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-22cba29 elementor-widget elementor-widget-heading\" data-id=\"22cba29\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Overview of the Iris Flower Prediction App<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-24d63b1 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"24d63b1\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-cb31df6\" data-id=\"cb31df6\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-cfc8fa7 elementor-widget elementor-widget-text-editor\" data-id=\"cfc8fa7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tToday, we will be building a simple machine learning-powered web app for predicting the class label of Iris flowers as being setosa, versicolor and virginica.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-6ea1360 elementor-widget elementor-widget-text-editor\" data-id=\"6ea1360\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tPerhaps, you have seen too many use of the infamous Iris dataset in tutorials and machine learning examples. Please bear with me on this one as the Iris dataset is merely used as a sort of \u201c<em>lorem ipsum\u201d<\/em>\u00a0(typically used as fillers words in writing contents). I assure you that I will use other example datasets in future parts of this tutorial series.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0907883 elementor-widget elementor-widget-text-editor\" data-id=\"0907883\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<p>This will require the use of three Python libraries namely &lt;code&gt;streamlit&lt;\/code&gt;, &lt;code&gt;pandas&lt;\/code&gt; and &lt;code&gt;scikit-learn&lt;\/code&gt;.<\/p>\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-91a6987 elementor-widget elementor-widget-text-editor\" data-id=\"91a6987\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tLet\u2019s take a look at the conceptual flow of the app that will include two major components: (1) the front-end and (2) back-end.<\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-ee8d092 elementor-widget elementor-widget-text-editor\" data-id=\"ee8d092\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tIn the<strong>\u00a0<em>front-end<\/em><\/strong>, the sidebar found on the left will accept input parameters pertaining to features (<em>i.e.<\/em>\u00a0petal length, petal width, sepal length and sepal width) of Iris flowers. These features will be relayed to the back-end where the trained model will predict the class labels as a function of the input parameters. Prediction results are sent back to the front-end for display.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-e5c7a0b elementor-widget elementor-widget-text-editor\" data-id=\"e5c7a0b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tIn the\u00a0<strong><em>back-end<\/em><\/strong>, the user input parameters will be saved into a dataframe that will be used as test data. In the meantime, a classification model will be built using the random forest algorithm from the\u00a0<code>scikit-learn<\/code>\u00a0library. Finally, the model will be applied to make predictions on the user input data and return the predicted class labels as being one of three flower type: setosa, versicolor or virginica. Additionally, the prediction probability will also be provided that will allow us to discern the relative confidence in the predicted class labels.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-7c4a9f4 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"7c4a9f4\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ebe1030\" data-id=\"ebe1030\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-304c39a elementor-widget elementor-widget-heading\" data-id=\"304c39a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Install prerequisite libraries<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-fe7c33b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"fe7c33b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e7460c0\" data-id=\"e7460c0\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-8b56a03 elementor-widget elementor-widget-text-editor\" data-id=\"8b56a03\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tIn this tutorial, we will be using three Python libraries namely\u00a0<code>streamlit<\/code>,\u00a0<code>pandas<\/code>\u00a0and\u00a0<code>scikit-learn<\/code>. You can install these libraries via the\u00a0<code>pip install<\/code>\u00a0command.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:paragraph -->\n<p id=\"5021\">To install streamlit:<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:preformatted -->\n<pre class=\"wp-block-preformatted\">pip install streamlit<\/pre>\n<!-- \/wp:preformatted -->\n\n<!-- wp:paragraph -->\n<p id=\"e3e8\">To install pandas:<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:preformatted -->\n<pre class=\"wp-block-preformatted\">pip install pandas<\/pre>\n<!-- \/wp:preformatted -->\n\n<!-- wp:paragraph -->\n<p id=\"5556\">To install scikit-learn:<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:preformatted -->\n<pre class=\"wp-block-preformatted\">pip install -U scikit-learn<\/pre>\n<!-- \/wp:preformatted -->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-e2bbf93 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"e2bbf93\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-e2eb67e\" data-id=\"e2eb67e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-00d3500 elementor-widget elementor-widget-heading\" data-id=\"00d3500\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Code of the web app<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-a75e8ae elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"a75e8ae\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-83ee34e\" data-id=\"83ee34e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-694b7df elementor-widget elementor-widget-text-editor\" data-id=\"694b7df\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tOkay, so let\u2019s take a look under the hood and we will see that the app that we are going to be building today is less than 50 lines of code (<em>i.e.<\/em>\u00a0or 48 to be exact). And if we delete blank lines and comments (<em>i.e.<\/em>\u00a0accounting for 12 lines) we can bring the number down to 36 lines.<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:frisfruitig\/block-gist-embed {\"url\":\"https:\/\/gist.github.com\/dataprofessor\/bfd5908a197a7e8a6bdf0206cc166cdc#file-iris-ml-app-py\",\"jsonFiles\":\"[{u0022nameu0022:u0022iris-ml-app.pyu0022,u0022checkedu0022:1}]\",\"filesFetched\":1,\"userHasInteracted\":1} \/-->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-38dfd24 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"38dfd24\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ffd8c5f\" data-id=\"ffd8c5f\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b59198c elementor-widget elementor-widget-heading\" data-id=\"b59198c\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Line-by-line explanation of the code<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-dfc30de elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"dfc30de\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-f93a471\" data-id=\"f93a471\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9092d2e elementor-widget elementor-widget-text-editor\" data-id=\"9092d2e\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tOkay, so let\u2019s decode and see what each line (or code block) is doing.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-3dcb0fa elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3dcb0fa\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-b11ce90\" data-id=\"b11ce90\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-622ef04 elementor-widget elementor-widget-heading\" data-id=\"622ef04\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Import libraries<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-02a180d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"02a180d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-04c0116\" data-id=\"04c0116\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-d737f2f elementor-widget elementor-widget-text-editor\" data-id=\"d737f2f\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!-- wp:list -->\n<ul>\n<li><strong><em>Lines 1\u20134<\/em><\/strong><br \/>Import\u00a0<code>streamlit<\/code>\u00a0and\u00a0<code>pandas<\/code>\u00a0libraries with aliases of\u00a0<code>st<\/code>\u00a0and\u00a0<code>pd<\/code>, respectively. Specifically, import the\u00a0<code>datasets<\/code>\u00a0package from the scikit-learn library (<code>sklearn<\/code>) where we will subsequently make use of the loader function to load the Iris dataset (line 30). Finally, we will specifically impor the\u00a0<code>RandomForestClassifier()<\/code>\u00a0function from the\u00a0<code>sklearn.ensemble<\/code>\u00a0package.<\/li>\n<\/ul>\n<!-- \/wp:list -->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-5a92235 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"5a92235\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-dcf6818\" data-id=\"dcf6818\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-a142738 elementor-widget elementor-widget-heading\" data-id=\"a142738\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\"><em>Side Panel<em><\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-ce92134 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"ce92134\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-25bed1a\" data-id=\"25bed1a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-47c0d66 elementor-widget elementor-widget-text-editor\" data-id=\"47c0d66\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!-- wp:list -->\n<ul>\n<li><strong><em>Line 11<\/em><\/strong><br \/>We will be adding the header text of the sidebar by using\u00a0<code>st.sidebar.header()<\/code>\u00a0function. Notice that the use of\u00a0<code>sidebar<\/code>\u00a0in between\u00a0<code>st<\/code>\u00a0and\u00a0<code>header<\/code>\u00a0(<em>i.e.<\/em>\u00a0thus\u00a0<code>st.sidebar.header()<\/code>\u00a0function) tells streamlit that you want the header to be placed in the sidebar panel.<\/li>\n<li><strong><em>Lines 13\u201323<\/em><\/strong><br \/>Here we will be creating a customized function called\u00a0<code>user_input_features()<\/code>\u00a0that will essentially consolidate the user input parameters (<em>i.e.<\/em>\u00a0the 4 flower characteristics that can accept the user specified value by means of the slider bar) and return the results in the form of a dataframe. It is worthy to note that each input parameter will accept user specified values by means of the slider button as in\u00a0<code>st.sidebar.slider(\u2018Sepal length\u2019, 4.3, 7.9, 5.4)<\/code>\u00a0for the Sepal length. The first of the four input arguments correspond to the label text that will be specified above the slider button which in our case is\u00a0<code>\u2018Sepal length\u2019<\/code>\u00a0while the next 2 values corresponds to the minimum and maximum value of the slider bar. Finally, the last input argument represents the default value that will be selected upon loading the web app, which is set to 5.4.<\/li>\n<\/ul>\n<!-- \/wp:list -->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-27c31aa elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"27c31aa\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-2978e4c\" data-id=\"2978e4c\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-9294ac7 elementor-widget elementor-widget-heading\" data-id=\"9294ac7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Model Building<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-698ed3d elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"698ed3d\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-a2fd8f3\" data-id=\"a2fd8f3\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-bcb482a elementor-widget elementor-widget-text-editor\" data-id=\"bcb482a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!-- wp:list -->\n<ul>\n<li><strong><em>Line 25<\/em><\/strong><br \/>As previously discussed above, the consolidated user input parameter information in the form of a dataframe will be assigned to the\u00a0<code>df<\/code>\u00a0variable.<\/li>\n<li><strong><em>Lines 30\u201338<\/em><\/strong><br \/>This code block pertains to the actual model building phase.<br \/>*\u00a0<em>Line 30 \u2014\u00a0<\/em>Loads in the Iris dataset from the\u00a0<code>sklearn.datasets<\/code>\u00a0package and assign it to the\u00a0<code>iris<\/code>\u00a0variable.<br \/>*\u00a0<em>Line 31 \u2014<\/em>\u00a0Creates the\u00a0<code>X<\/code>\u00a0variable containing the 4 flower features (<em>i.e.<\/em>\u00a0sepal length, sepal width, petal length and petal width) provided in\u00a0<code>iris.data<\/code>.<br \/>*\u00a0<em>Line 32 \u2014\u00a0<\/em>Creates the\u00a0<code>Y<\/code>\u00a0variable pertaining to the Iris class label provided in\u00a0<code>iris.target<\/code>.<br \/>*\u00a0<em>Line 34 \u2014\u00a0<\/em>Assign the random forest classifier, particularly the\u00a0<code>RandomForestClassifier()<\/code>\u00a0function, to the\u00a0<code>clf<\/code>\u00a0variable.<br \/>*\u00a0<em>Line 35 \u2014\u00a0<\/em>Train the model via the\u00a0<code>clf.fit()<\/code>\u00a0function by using\u00a0<code>X<\/code>\u00a0and\u00a0<code>Y<\/code>\u00a0variables as input arguments. This essentially means that a classification model will be built by training it using the 4 flower features (<code>X<\/code>) and class label (<code>Y<\/code>).<\/li>\n<\/ul>\n<!-- \/wp:list -->\n\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-3fced7b elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"3fced7b\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-06e977a\" data-id=\"06e977a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-c06e9bc elementor-widget elementor-widget-heading\" data-id=\"c06e9bc\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h3 class=\"elementor-heading-title elementor-size-default\">Main Panel<\/h3>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-bb729f6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"bb729f6\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-503ba95\" data-id=\"503ba95\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-6cc667b elementor-widget elementor-widget-text-editor\" data-id=\"6cc667b\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t<!-- wp:list -->\n<ul>\n<li><strong><em>Lines 6\u20139<\/em><\/strong><br \/>Uses the\u00a0<code>st.write()<\/code>\u00a0function to print out text, which in our case we are using it to print out the title of this app in markdown format (making use of the # symbol to signify header text (line 7) whereas normal descriptive text of the app is provided in the subsequent line (line 8).<\/li>\n<li><strong><em>Lines 27\u201328<br \/><\/em><\/strong>This first section will be given the subheader text (assigned by using the\u00a0<code>st.subheader function<\/code>) of\u00a0<code>\u2018User Input parameters\u2019<\/code>. In the subsequent line we will be displaying the contents of the\u00a0<code>df<\/code>\u00a0dataframe via the use of the\u00a0<code>st.write()<\/code>\u00a0function.<\/li>\n<li><strong><em>Lines 40\u201341<\/em><\/strong><br \/>In this second section of the main panel, the class labels (<em>i.e.<\/em>\u00a0setosa, versicolor and virginica) and their corresponding index numbers (<em>i.e.<\/em>\u00a00, 1 and 2) are printed out.<\/li>\n<li><strong><em>Lines 43\u201344<\/em><\/strong><br \/>Predicted class labels are displayed in this third section of the main panel. It should be noted here that the contents of the\u00a0<code>prediction<\/code>\u00a0variable (line 45) is the predicted class index number and for the class label (<em>i.e.<\/em>\u00a0setosa, versicolor and virginica) to be displayed we will need to use the\u00a0<code>prediction<\/code>\u00a0variable as an argument inside the bracket of\u00a0<code>iris.target_names[prediction]<\/code>.<\/li>\n<li><strong><em>Lines 47\u201348<\/em><\/strong><br \/>In this fourth and last section of the main panel, the prediction probability are displayed. This value allow us to discern the relative confidence for the predicted class labels (<em>i.e.<\/em>\u00a0the higher the probability values the higher confidence we have in that prediction).<\/li>\n<\/ul>\n<!-- \/wp:list -->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-99e6312 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"99e6312\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-ea77973\" data-id=\"ea77973\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-b903ddd elementor-widget elementor-widget-heading\" data-id=\"b903ddd\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Running the web app<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-eceef4e elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"eceef4e\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4bfe582\" data-id=\"4bfe582\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-502eaf7 elementor-widget elementor-widget-text-editor\" data-id=\"502eaf7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tSo the code of the web app is saved into the iris-ml-app.py file and now we are ready to run it. You can run the app by typing the following command into your command prompt (terminal window):<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:preformatted -->\n<pre class=\"wp-block-preformatted\">streamlit run iris-ml-app.py<\/pre>\n<!-- \/wp:preformatted -->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-eaaa9f1 elementor-widget elementor-widget-text-editor\" data-id=\"eaaa9f1\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tAfterwards, you should see the following message:<\/p>\n<!-- \/wp:paragraph -->\n\n<!-- wp:preformatted -->\n<pre class=\"wp-block-preformatted\">&gt; streamlit run iris-ml-app.pyYou can now view your Streamlit app in your browser.Local URL: <a href=\"http:\/\/www.experfy.com:8501\/\">http:\/\/www.experfy.com:8501<\/a><br \/>Network URL: http:\/\/10.0.0.11:8501<\/pre>\n<!-- \/wp:preformatted -->\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-d9b7e01 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"d9b7e01\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-bc2479a\" data-id=\"bc2479a\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-eb491c0 elementor-widget elementor-widget-text-editor\" data-id=\"eb491c0\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tA few seconds later, an internet browser window should pop-up and directs you to the created web app by taking you to\u00a0<code><a href=\"http:\/\/www.experfy.com:8501.\/\">http:\/\/www.experfy.com:8501<\/a><\/code>\u00a0as shown below.\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-9afa731 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"9afa731\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-4298608\" data-id=\"4298608\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-12a817a elementor-widget elementor-widget-image\" data-id=\"12a817a\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/miro.medium.com\/max\/1308\/1*-ARcJgSU6vT5or6Qcgg6lA.png\" alt=\"\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-47559ce elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"47559ce\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-78f012e\" data-id=\"78f012e\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-fae0cd4 elementor-widget elementor-widget-heading\" data-id=\"fae0cd4\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Congratulations! You have created your ML-powered web app in Python!<\/h2>\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<section class=\"has_eae_slider elementor-section elementor-top-section elementor-element elementor-element-f8736ae elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"f8736ae\" data-element_type=\"section\" data-e-type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"has_eae_slider elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-660e6cb\" data-id=\"660e6cb\" data-element_type=\"column\" data-e-type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t<div class=\"elementor-element elementor-element-50792c7 elementor-widget elementor-widget-text-editor\" data-id=\"50792c7\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\tNow, it\u2019s time to give yourself a pat on the back as you have now created a machine learning-powered web app. It\u2019s now time to showcase this in your data science portfolio and website (<em>i.e.<\/em>\u00a0you might want to customize the web app by using a dataset that interests you). Make sure to check out these videos on pointers and advice (<a href=\"https:\/\/www.youtube.com\/watch?v=fCXBaEnPzgo\" target=\"_blank\" rel=\"noreferrer noopener\">Building your Data Science Portfolio with GitHub<\/a>\u00a0and\u00a0<a href=\"https:\/\/www.youtube.com\/watch?v=mEZ1Hj5yQ-8\" target=\"_blank\" rel=\"noreferrer noopener\">How to Build a Data Science Portfolio Website with Hugo &amp; Github Pages [feat. Data Professor]<\/a>).\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>This article will show you how to build a simple machine learning powered data science web app in Python using the streamlit library in less than 50 lines of code.<\/p>\n","protected":false},"author":886,"featured_media":10379,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"content-type":"","footnotes":""},"categories":[187],"tags":[92,114,745,641],"ppma_author":[3736],"class_list":["post-10378","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bigdata-cloud","tag-machine-learning","tag-python","tag-streamlit-library","tag-web-app"],"authors":[{"term_id":3736,"user_id":886,"is_guest":0,"slug":"chanin-nantasenamat","display_name":"Chanin Nantasenamat","avatar_url":"https:\/\/www.experfy.com\/blog\/wp-content\/uploads\/2020\/08\/Chanin-Nantasenamat-150x150.jpg","user_url":"http:\/\/www.mahidol.ac.th\/mueng\/","last_name":"Nantasenamat","first_name":"Chanin","job_title":"","description":"Chanin Nantasenamat is Associate Professor and Head, Center of Data Mining and Biomedical Informatics at Mahidol University, Thailand. He is also Founder of Data Professor YouTube Channel and Associate Editor at Frontiers in Pharmacology. Thought Leader on AI and ML Education, he was a Visiting Professor at Uppsala University, Lund University, University of California at Los Angeles as well as the California State University at Fullerton."}],"_links":{"self":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/10378","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/users\/886"}],"replies":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/comments?post=10378"}],"version-history":[{"count":7,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/10378\/revisions"}],"predecessor-version":[{"id":33613,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/posts\/10378\/revisions\/33613"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media\/10379"}],"wp:attachment":[{"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/media?parent=10378"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/categories?post=10378"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/tags?post=10378"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.experfy.com\/blog\/wp-json\/wp\/v2\/ppma_author?post=10378"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}