logo

Binary Regression, Logistic Regression and Generating Data using Python Co

   

Added on  2021-10-16

15 Pages2140 Words354 Views
Machine Learning

Table of Contents
1. Introduction...................................................................................................................................2
2. Matrix Multiplication....................................................................................................................2
3. Binary Logistic Regression............................................................................................................3
4. Multi - Class Classification............................................................................................................3
5. Logistic Regression.......................................................................................................................4
6. Softmax.........................................................................................................................................5
7. Batch Gradient Descent.................................................................................................................6
8. Stochastic Gradient Descent..........................................................................................................7
9. Conclusion.....................................................................................................................................8
References.............................................................................................................................................9
1. Introduction
1

In this project to compute the binary regression, logistic regression and generate the data
using python code. We are using the mnist pickle file to run the program. We are developing
the matrix multiplication, multi- class classification, binary regression and logistic regression
using python. It has the separated file and using python code to develop the task. The first
task is to develop the matrix multiplication and display the scatter plot. The second task to
develop the binary logistic regression for generates the data and it displays the scatter plot.
The third task to develop the multi classification and using the mniist file to generate the
recall curve. The fourth task is logistic regression and it calculates the entropy by using the
formula. The fifth task is softmax and we are calculate the cross entropy related to task 4.The
sixth task is batch gradient descent and it develop the muliti class classification. The seventh
task is stochastic gradient descent and it displays the output to relate to the batch size.
2. Matrix Multiplication
a) In the first task to create the matrix multiplication and it calculate the values. We are
create the A×A matrix. The matrix begins at 0 not 1.The first element has the 7 row and
0 column. And the second element has the 0 row and 4 columns. We are using the
numpy array for create the element wise multiplication. Consider the two dimensional
numpy array A and B. It perform the matrix multiplication using the python code. In
additionally we using the vector. The array and the vector can be executed in parallel. If
A is matrix in row and v is vector for column (Allison and Allison, 2012). If A is matrix
in column and v is vector in row. We adding the matrix and vector like A+V to every
element. It also avoiding the iterating function.
2

b) Finally it displays the output in scatter plot. The task includes the additional task. For
binary classification problem, first generate the data and plot the two dimensional
data. The array include the function and the function should return the array x and
t.And the function generate the two cluster like sigma0 and sigma1.
c) And the data display the scatter plot using red dots and blue dots. The red and blue
dots denoted as the cluster. Red dots for points in cluster 0 and blue dots for points in
cluster 1.

3. Binary Logistic Regression
To generate the classifier of two cluster data. It also generates the precision recall
curve. In the task first generate the data and calculate the covariance matrix for same cluster.
We are using the t value to generate the data and it displays the graph for the points. The
predict value has negative value, positive value, true positive value, true negative value, false
3

End of preview

Want to access all the pages? Upload your documents or become a member.