‫Hello and this will do.
‫We will create a very simple single person run more than to classify flower species depending on their
‫pattern length and pattern.
‫We will be using a skill to create this single person prone model.
‫In the latter part of this course we will use gave us and that flow to create mighty level parts of
‫models.
‫Skillern is a very popular machine learning library for Python it is the go to library to create regression
‫classification.
‫This year increase or as we are mortals we have separate lectures on all this machine learning models.
‫So if you are interested in learning any one of these you can go ahead and check out courses on regression
‫classification between trees and SVM so let's start first.
‫We will import numbers and find us.
‫Now if you have installed Anaconda there is no need to install a skill on separately.
‫You just have to import a scanner.
‫But in case you are facing any editing importing a skill you can install it using pip or Condi installed.
‫So just run this Come on pip install a Skillern in your command prompt you can open your command prompt
‫by pressing windows out and right CMB in the run come on and hit enter there in the command prompt you
‫can write this code and execute it to install that skill in or else you can directly run this code and
‫despite the notebook and this will also install escalation for you.
‫So if you have installed a skill on first We will load to Iris data.
‫There are various CSP files out there.
‫You can also import those CSC failed to load this data but as skilled on have some predefined data sets
‫and we will load our Iris data from there.
‫So just write from a scale on dot datasets import load underscored itis and then we are saving the word
‫Iris data into this variable Iris.
‫So just run this now.
‫Let's take a look at our data.
‫You can see there are four columns two columns that set a length separate by the length and patterns
‫with as I said earlier this data of different types of flowers.
‫There are three different types of flowers sir dosa What's the colour Virginia.
‫And for each of this flower we have their separate land separate but the length and petals.
‫So here we have these four variables and that category is stored in Iris dot target.
‫So in our example we want to create a perception model which would identify whether the flower is that
‫dosa or not using it and by land as the independent variables if you want you can take all the four
‫variables but for our example we are just taking these two variables to predict where the flower is
‫that shows up or not.
‫So we want our independent variable to be this by the lantern petals which we will store this information
‫in another variable which we are calling X. We are defining X as Iris dark data and here we just want
‫the third and fourth column.
‫That's why we have returned to common three.
‫If you remember the indexing it starts with 0.
‫So the last two columns are two and three.
‫Just run this so our x variable is now ready.
‫Now let's just look at the target variable here.
‫You can see we have different categories 0 1 and 2 0 percent for the set dosa one sentence for what
‫colour and 2 cents for Virginia.
‫Now if you have some machine learning knowledge you may know that to create classification more than
‫a what via variable should be in the form of 0 and 1.
‫So ideally we want one and all these records where the flower is set up and 0 and all these records
‫where the flower is virtually color or Virginia so let's just convert this target variable using some
‫basic operations first let's convert this target variable in the form of true and false we want crew
‫where the flower is set dosa that is the value of Target is 0 and we want false where the flower is
‫pathogenic or what color that is the numerical value is 1 or 2.
‫So let's just blend this Come on we are just checking whether the target is equal to zero or not if
‫the target is zero we will get group and if the target is not equal to zero we will get false let's
‫run this pain.
‫Now let's look at our way variable you can see we have converted zeros to crew and one or two boot false
‫now in the next step.
‫We want to convert this crew in falls to 1 and 0.
‫We want one in place of crew and we want zero in place of false.
‫So we will just use as pipe method and we will convert it to.
‫And so just on and look at our Y variable.
‫So as you can see now our Y variable is an array with 1 and 0 1 means that dosa and zero means not set
‫so
‫now let's look at our x variable before creating open it's up front more than you can see our x variable
‫is a two dimensional array with by the length and by the late
‫know over X and Y variable separately.
‫We just have to create our perception model and train that model using this x and y variables
‫we can create a single concept drawn more than using Eskil then.
‫But to create MLP on my level but it's up front more than we have to use k does an intensive look.
‫We will be looking at an LP in the later part of this scopes but now we will create this but it's up
‫grown model using Escalade only
‫now.
‫First we need to import spectrum from a scale undoubtedly no more than let's just import it and you
‫can also look at the documentation using this link.
‫This is department notebook is also shared in the resources section of this video.
‫So you can download it and learn it if you want to practice.
‫So this is the official document of Sep drawn in Eskil Skillern you can look at all the parameters which
‫we can give.
‫The first one is the penalty if you remember in linear regression there are regularization domes L1
‫a two also known as lasso and rich.
‫You can also give a fart that is the variable we use for regularization.
‫Then there are different other hyper parameters.
‫We will just stick to basic default high but parameters.
‫But you can look at it if you want.
‫These are just some very basic high but parameters that we get with most of the machine learning algorithms
‫now.
‫As with any other skill on machine learning model we first have to create an object of the Talbot item.
‫Then we have to fit over x and y variables and put that object and then we can use that object to predict
‫the future values of Y.
‫So first let's create an object that is perceptive on classifier we are naming all the variables but
‫underscored CnF and then we are using perception that we have just imported and we are giving on the
‫one hyper parameter that is random I say to equate to 42.
‫This is basically to reproduce the same result whenever we run this model.
‫So if you give random a set you will always going to get the same result.
‫Giving this hyper parameter is not mandatory.
‫You can skip that also if you want and in the next line we are fighting over x and y variables into
‫this object.
‫So let's fund this.
‫So what model is screened.
‫You can get the values of different types but I might add here.
‫If you want.
‫Now let's predict the value using the word classifier object we can just use dot predict my term.
‫So this is a word object and we are using dot product and we are giving our independent inquiry but
‫which is x as an input.
‫Let's do that.
‫You can see this are the predicted values.
‫We can compare this predicted values with the actual values.
‫There is no need to manually do that.
‫There is then another function that is accuracy scored available in Ashkelon which will give us the
‫accuracy for what prediction accuracy score vary between 0 and 1 0 means 0 percent accuracy which means
‫all the predictions are wrong and one means hundred percent accuracy which meant all the predictions
‫outright.
‫So let's just first and the accuracy score from a scalar not my kicks and then we are going to use accuracy
‫score.
‫And here there are two arguments.
‫First we have to provide the actual values and in the next type of humans we have to provide the predicted
‫values.
‫So what actual values are restored in just by a variable and the predicted values we have is stored
‫in y underscore right.
‫So let's get the accuracy squared off forward predictions.
‫So the accuracy here is one that is a hundred percent accuracy or what perception was able to identify
‫the specie of the float with 100 percent accuracy.
‫Now this is a very simple model.
‫Usually we don't use parts of upfront for any regression or classification tasks we usually go for machine
‫learning techniques where the data is not following any context pattern and we usually go for.
‫And that would be where the data is falling a very complex pattern.
‫Usually you will never find yourself using but it's a drawn.
‫And business settings but this is just center in production and we want you to give just some basic
‫idea about running but sap run models using ask them now after training your more than you will get
‫these two attributes that is the coefficient and then that Sept basically over perception as dividing
‫this is space using linear regression line.
‫So this is the coefficient and this is the intercept of that line.
‫So your equation of that line will be for minus one point four times the length minus two point two
‫times battle.
‫So if you want to cleared that line you can use coefficient and intercept values to do that and you
‫can also see the impact of our different variables on the Y variable.
‫So this coefficient is giving you the impact of each of those variables.
‫This is the impact of the land and this the impact of the.
‫That's all for this lecture.
‫Next we will look at tensor flow and get us to create our MLP model.
‫Thank you.