In this lecture, we are going to create a neural network model, but we will not use the Gatehouse
package.
We will instead use the new Rolex package.
All of us is more widely used today.
You should also know what this package, because it is a very simple code.
Good for this is actually simpler than Nick Gordon gave us.
Secondly, discord looks more like the court for other congressional machine learning techniques, a
not so seasoned art user may prefer this court for implementing neural network for similar problems.
So let's start.
As usual, we start by installing and activating the new package called neural net.
Here we installed the package.
Then we only require a mind.
To load this package.
You can see on the right hand side that this package has our take on it.
That is this package is now active.
Next here, I'm creating a smaller bee, does it?
Which I'm calling D.F..
So the FSD does.
It has three columns as representing the number of hours a student has studied before an exam.
Next is Mock Test, which is representing students schooled in a more test or practice test.
And last is Bost, representing Vedette, the student past the main exam on North.
So this is the data frame.
It has three columns.
And here are the values that I input in these three columns.
Now, listen, all these command.
And let's have a look at the D.F..
The data that we have created.
So you're going to look at this.
It has three features and six observations.
Mock test and bust.
Next, we train a model using the neural net function.
If you've seen linear regression in art, you will notice that this has a very similar structure to
that function.
The first barometer of dysfunction.
Is telling the model about output variable and the predicted variables.
So the variable on the left hand side of this listenable.
Is considered as the variable to be predicted and all the variables to the date.
Deep predicted variables.
These variables belong to the data named D.F..
Hidden is equal to three comma two means that we want to hit and let's first hit and left will have
three neurons, and the second, the left will have two neurons.
If you specify only one number here, say if you write it down is equal to three.
That means you will have only one had to live with three neurons.
Next, barometer's activation function, which we set as logistic.
And lastly, lenient output is equal to falls means that we are doing classification.
If we put this as true, that would mean that we are doing regression and the design of this neural
network function will be stored in the variable called.
And then let's run this.
Now, the next come on is my favorite thing about this method.
Let's just run it and see.
This gives a very clean visual representation of our model.
These numbers here are the weight and these numbers in blue are the biases.
So you can clearly figure out which neuron is doing what from this graph.
Here you can also see that and be first in alert.
We have three neurons and in the second in the lead, we have two neurons.
If we go and change this.
He didn't, but I mean.
Then we'll have a different neural network structure here.
Now to show you how to find this said predictions.
I have created another dataset called Test.
It is this this dataset.
It has to close the yards and be more pissed, the Yards has these three values and demarked best has
these three values.
Let's run this and look at the desert.
So basically we are saying that we have data for every student.
The first student has studied for 20 years and had earlier scored 80 in the practice test.
The second student has again studied for 20 years, but scored only 13 marks in the practice test.
And the total, they studied for 30 years and scored 20 in the practice test.
Now we want to predict which of these students will pass and which of them will be.
To predict whether these students will pass or fail, we use the compute function.
In this, we give our train model as the first parameter that is stored in in in.
And best as the second barometer, which is these tests said that we have created.
The output of this function will be stored in a variable called predict next on this.
So you can see a new variable called Predicted Created, which is a list of two.
If you want to look at the predicted probabilities, we can run this, come on now, does predict dollar
net daughter.
Now you can make out just by looking at diplomatese.
That which student is likely to pass and which is likely to fail.
However, if you want to assign a glass, you can use, it fails.
That is, if the probability is greater, ten point five.
Then we will see that this student has passed.
So we will assign one.
And if it is less, then point you, there is a student history and will assign Zillo.
So let's run this code also.
You can see that we are predicting that first two students will pass and a third student is likely to
fail the exam.
Well, that's all we just made a complete neural network model in a few minutes.
And you'd like to make predictions, as you can see.
This library is simple, but it is not as flexible as guitars and antiflu.
So for simple mortals, you can use it.
That's all.
Thank you.