Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

logistics_x.txt: 1.343250400 -1.331147900 1.820552900 -0.634668100 0.986320670 -1.888576200 1.94E+00 -1.64E+00 9.77E-01 -1.35E+00 1.945858400 -2.044327800 2.11E+00 -2.125668400 2.07E+00 -2.46E+00 8.69E-01 -2.41E+00 1.80E+00 -2.77E+00 3.13E+00 -3.445243200 3.09E+00 -3.644614500

image text in transcribed

logistics_x.txt:

1.343250400 -1.331147900 1.820552900 -0.634668100 0.986320670 -1.888576200 1.94E+00 -1.64E+00 9.77E-01 -1.35E+00 1.945858400 -2.044327800 2.11E+00 -2.125668400 2.07E+00 -2.46E+00 8.69E-01 -2.41E+00 1.80E+00 -2.77E+00 3.13E+00 -3.445243200 3.09E+00 -3.644614500 2.91E+00 -4.006503700 2.68E+00 -3.019859200 2.75E+00 -2.710056100 4.17E+00 -3.462248200 3.93E+00 -2.109904400 4.38E+00 -2.380474300 4.80E+00 -3.380334400 4.17E+00 -2.813884400 2.47E+00 -1.610844400 3.48E+00 -1.553387200 3.37E+00 -1.816493600 2.88E+00 -1.851168900 3.11E+00 -1.638494600 2.22E+00 0.074279558 1.99E+00 0.162686590 2.95E+00 0.016873016 2.02E+00 0.172273870 2.05E+00 -0.635810410 8.75E-01 -0.545861680 5.71E-01 -0.033278660 1.43E+00 -0.752883370 7.23E-01 -0.866919300 9.53E-01 -1.489695600 4.83E+00 0.070175439 4.31E+00 1.415204700 6.03E+00 0.450292400 5.42E+00 -2.707602300 3.46E+00 -2.824561400 2.73E+00 -0.923976610 1.00E+00 0.771929820 3.66E+00 -0.777777780 4.31E+00 -1.040935700 3.69E+00 -0.105263160 5.74E+00 -1.625731000 4.98E+00 -1.508771900 6.50E+00 -2.912280700 5.24E+00 0.918128650 1.68E+00 0.567251460 5.17E+00 1.210366700 4.88E+00 1.608184800 4.66E+00 1.069553200 4.49E+00 1.235159200 4.15E+00 0.867212600 3.72E+00 1.151720000 3.62E+00 1.310676900 3.06E+00 1.485716300 7.07E+00 -0.349616510 6.04E+00 -0.247568320 6.67E+00 -0.124847660 6.85E+00 0.259771670 6.43E+00 -0.147138630 6.85E+00 1.475496700 7.71E+00 1.604555500 6.29E+00 2.415642700 6.98E+00 1.259986500 7.10E+00 2.215515100 5.53E+00 0.299684210 5.83E+00 -0.219744080 6.36E+00 0.239442170 6.10E+00 -0.040957414 5.62E+00 0.371359140 5.88E+00 2.776818600 5.58E+00 3.068288900 7.01E+00 -0.257817270 4.45E+00 0.839418310 5.65E+00 1.305392900 4.63E+00 1.946754600 3.70E+00 2.259408400 4.12E+00 2.547451000 4.77E+00 2.753120900 3.08E+00 2.798525500 4.07E+00 -3.029239800 3.49E+00 -1.888888900 7.69E-01 1.210526300 1.50E+00 3.812865500 5.80E+00 -2.093567300 6.81E+00 -0.834567300 7.11E+00 -1.020115800 7.49E+00 -1.742690100 3.14E+00 0.421052630 1.68E+00 0.508771930 2.49E+00 -0.865497080 4.77E+00 0.099415205 5.83E+00 -0.690058480 2.29E+00 1.970760200 2.49E+00 1.415204700 2.08E+00 1.356725100

logistics_y.txt

-1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1

Code implemented in python

3.3 Part II - 25 points We have provided two data files: logistics-x.txt and logistics-y.txt these files contain the inputs (OER) and outputs (y E{-1,1)), respectively for a binary classification problem, with one training example per row. 1. Implement a gradient descent method (or a Newton method) for optimizing JO), and apply it to fit a logistic regression model to the data. Initialize your method with 0 = 0 (the vector of all zeros). What are the coefficients O resulting from your fit? (15 points 2. Plot the training data (your axes should be xi and C2, corresponding to the two coordinates of the inputs, and you should use a different symbol for each point plotted to indicate whether that example had label 1 or -1). Also plot on the same graph the decision boundary fit by logistic regression. (This should be a straight line showing the boundary separating the region where ho(x) > 0.5 from where ho(2) 0.5 from where ho(2)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Students also viewed these Databases questions