Deploy Machine Learning Models Using StreamLit Library- Data Science

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hello my name is Krishna and welcome to my youtube channel so there's today in this particular video we'll try to deploy a machine learning model with the help of srimad library in our previous video we have already seen how to deploy models with the flask app and in this particular example we will be focusing on this banknote authentication model and remember I have taken this particular project in my playlist which is funneled into in deputation now before going ahead with respect to this particular media days if you are looking for Career Transition advice please make sure that he was this video till the end because that thing I am going to show you some important information so let's go ahead and try to see it twice and again I'm telling you I'm just going to show you that how we created the modern because already this is explained in my daughter into any playlist so this particular data set we which we download it was from the work from this particular link I have already given over there so you can go to this particular link download that particular dataset and this is the bank 420 kitchen tour CSV in this particular data set you have four variables like burial skewness kurtosis entropy and class class is basically my dependents teacher to determine whether the bank note so this particular value is based on this particular values we should be able to determine at this now considering this what I've done is that I've divided this into independent independent features then I have actually applied in a split did my train test plate with the test sizes 30% implementing the random forest classifier did some prediction or take an easy score and you can also find out the other performance metrics like precision to equal I hope I've shown this if you really want to go in much more depth to understand the user just go to this particular place that is talking to finish okay the link again will be given in the description then finally as soon as I create that particular model I'm going to create that little file so the pickle file name is classified not pickle now this is fine right you have created the pickle fine now we need to create the friend Peppa you know by using streamlet and when will be able to access the model also and then as soon if the input will also should be able to get the output considering this again in my daughter playlist I'd shown you how you can do with the help of flask app so this is with respect to the flask food in my daughter playlist I've actually shown you and what I'm going to do is that I'm going to take this same code okay with respect to string lit and I'm going to copy in my another file but remember what I'm going to do is that I am just going to uncomment all the flask flash there and you you remember guys we also we also created the front end with flask so so that we could actually give that for inputs in the front end and get out so I will be commenting down all these particular lines that is flask flask er I don't require this app dot out dot R out because now we are actually creating with the help of strimling instrument we do not have to write this a drunk you know so what I have done is that I just go to my app one but py now first of all I have to import streamlet as a steep now remember one thing guys the streamlet library we actually install so what I'm going to do is that in order to install you just right pip install string name right so this is the library that we have to install in order to use it and remember I have just into my I've just gone into my environment that is my env this is my environment where I'm actually is including this code and that I will just write that instantly so you can see that it says requirement already satisfied because I have actually or each to understand which library before itself so I'm just going to clear this I'm going to come over okay now going ahead what I have to do is that first of all I have to import the streamlet library so I have written input string rate as st okay then what I have done is that in my second man have just opened this classified article in read mode and add loaded that specific model at random forest model I have loaded it you can see that that AB dot route has commented out have commented out okay let's see from where this file begins if you really want to see the file will start executing from this lines of code it will load the pickle you can also write this inside your main function okay because this is the starting point of the execution now when since this is the start point of execution first the execution will go over here this particular line will become true it will go inside my main functions now in main function this is what is my main function over here okay now the first thing that I've done you have imported streamlet as st in strain rate inside that particular libraries you have properties like title you have text input you have a check box you have buttons and various of the properties you can definitely explore that in the website of strimling okay and that link will also be given in the description for you so what I've done is the first step are given the title of my data and remember guys the one thing common about one thing good thing about streamlet is that it's a good or bad but I'm not sure about that one thing that you can do or string it is that you can integrate the HTML code within this py5 you will not have a separate HTML code right so this looks like the cleanliness if I just talk about cleanliness it may not be that much because if you remember about flux we have a separate static folder we have a template folder we can also structure in that specific way where we keep all those things in the separate folder and try to call that but right now in this particular thing what I've done is that I have integrated the HTML static HTML code within this function itself so to begin with I written the street or title for filter paper and inside this band for integer this is basically my title of the web app then I have created some temporary HTML with some styling you know I hear they can diff style in the background color is this much color this is basically my half name you know in the header then what I've done is that I have taken this HTML and if I want to use this HTML have to use this st dot markdown property ok so I have to use this and I have to use this particular property and don't have to worry much about the front end thing guys there will be a team who'll actually help you with all this particular thing you just have to load it in the form of Martha now remember in my if you remember this particular problem statement we have to give four variables that is variance skewness kurtosis and entropy then my modern will be able to predict it you know it will be able to predict it now in case of flasks I had actually implemented a fluster a front-end web app where I will be giving the four inputs and then I click the predict butter now what I do is that I get that values I pass it to my model and get out now similarly over here I will be creating four text inputs so HT dot extension what a state or texting for digital or text input and this one with different different names obviously variance skewness kurtosis entropy okay and this pipe here is the default text that will be present over there now this is done right similarly I will get all these four values fine I've created a empty variable which is called as a result and if I say that is HT dot button of credit right that basically I am going to create a button which is in the name of credit and if that predict button is clicked you know so this becomes true this particular condition becomes true now in this condition what I am doing and calling a function which is called a spreading node authentication here I am passing four variables now if I go to this particular function if I go to this particular function you'll be able to see that in this function it is taking all these particular four parameters okay and it is saying that classified or predict here I passed this parent is in the form of list I can output and return that particular output back over here so that particular output gets stored in the result in this case the output will be 0 or 1 then what I am doing that there is again a property which is called a success if that particular thing is success we are going to display this print result the output is this one right the format reason whatever is that I'm allocating so this is just a format option where I'm actually trying to give my own or custom output statement so here the output is 1 it will become like output is 1 output is 0 then again I am clicking another button and I am creating another button which is called as about and inside this about button if I click it you know if I click it this will become 2 and it is going to disk this plate is true next you know just for some additional thing that I've just done you know you know do this and this is what I have done for this whole problem statement a simple you know a streamed in web app yes we can develop more complex web app which I will be showing you know my upcoming classes I can have multiple tabs in my web app also one weather will be predicting it with the help of HZ boost another web app sorry another tap will be actually predicting you type of random forest classifier it can be another another things and they are lot of properties apart from this case okay so I just try to show it show it for you and now if you really want to compare with respect to flask and strain rate I will also inform that in my coming classes now let's do one thing let's try to run this okay so I'm just going to go over here in order to run guys in order to run we usually in flask at me right - f1 dot my right but here I mean if you remember if you write like that already it gets executed from the main function it will be executing since file class is already there in this case we have to run in a different way we have to write streamlet run f1 dot v1 okay strain rate run upon what Kiba now if I execute this you will be seeing or it will take some time to run okay it's running now and the tab is open okay so here you can see that a bad cough indication back Authenticator streamlet Bank Authenticator ml I gave the tomato color right so this is what is the matter color this is my success where I will be displaying my results about section if I click on about you will be able to see that this tool is getting selected that we see you can see as soon as I click this this part becomes true right this part becomes true so we are getting let's learn built with similar okay now I have to again click on predict before that lets me give some values okay so here I am going to give - 4 - 5 1 2 - okay and if I do the prediction you'll be able to see the output is 1 if I go back to my weather sorry to my command prompt here also you can see the output is well so we are getting in a proper way if you really want to see with respect to zero also then we put this various tool and you can see it output is zero if I go back again to my anaconda prom here you can see the output is zero now this is a very very simple thing that what we are developed of simple back authenticate a web app where I am giving four inputs and getting the output you can definitely try by your side now what is I'll do in my next video I will create multiple tabs over here like this you know I will try to create multiple tabs like this one tab over here sorry for my bad drawing so one tab over here so if I click this stamp then I will be getting a different way back where the authentication will happen with the help of the frame classify in a qexg booster so this is just to show an example and more complex things I will try to do in my upcoming video I hope you like it again the comparison with respective flask and strangely I try to show you in upcoming videos but note one thing I think flask will be used by many of the people flask calls rangu will be used by many of the people yes that is just so one point that I really want to specify but in the coming video I will try to show you what are things we can do with it and all the different properties with respect to stream but it also has some good amazing features which I was actually exploring now guys if you are looking for career transition advice chewers data science please make sure that you go and watch springboard in here YouTube channel because here you'll be able to see lot of videos from the scientists who actually working in different different companies so yes this was all about this particular video I hope you liked it please to subscribe to channels and already systemics here in the next video have a great day thank you
Info
Channel: Krish Naik
Views: 107,449
Rating: undefined out of 5
Keywords: data science tutorial javatpoint, data science tutorial python, data science tutorial online free, python data science tutorial pdf, python data science tutorial point pdf, what is data science, data science tutorial tutorials point, data science course, nlp tutorial python, natural language processing python, natural language processing examples
Id: 5XnHlluw-Eo
Channel Id: undefined
Length: 12min 55sec (775 seconds)
Published: Sat Jun 13 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.