Introduction
My OS of computer is the windows10.
Implementation is used by Python3.
I use the IRLS to estimate optimization value.
I introduce the theory of Logistic Regression in another post.
If you interested, look at this post.
Overview
- I will introduce used data set
- I will introduce my code in Python
- I will show you result on Command line.
Dataset
I use this dataset to implement Logistic Regression.This dataset is Residential area data.
I diplay this data in Pandas DataFrame Python3.
This is data set from top to five elements.
if people live the house, occupancy is 1.
if people do not live the house, occupancy is 0.
This data consist of 8000 samples to use as training data, and 2000 samples to use as test data.
However I use 100 samples as training data and 100 samples as test data, because my computer is not designated programing.
Sorry, .
CODE
This code is very long.Thus, I publish my code of Logistice Regression in my Github.
My github page
My Logistic Regression code(def file)
My Logistic Regression code(main file)
Separating my code have reason. It is that I want to separate define file and main file. main file have
if __name__ == '__mian__'
my def file have algorithm of Logistic Regression. My code is defined class in def file. I will write about class in Python.Execution!
w is estimating…I will save figure of value of Closs-entropy error function
This is sactter plot of closs entropy error function.
I find out decreasing of value of closs entropy error funtion.
I finished estimating optimization.
I will test my model of Logistic Regression.
I compare my predict by Logistic Regression and correct class.
Percentage of correct answer is 98per.
I think this is high score.
By the way, Logistic Regression find out probability that each data point exists \(C_1\)
Please check out P columns.
As long as I identify, Almost the P is not near 0.5.
コメント
コメントを投稿