Fill This Form To Receive Instant Help

Help in Homework
trustpilot ratings
google ratings


Homework answers / question archive / CSE 6363: Machine Learning Assignment 1 This assignment covers linear regression and logistic regression using discriminative methods

CSE 6363: Machine Learning Assignment 1 This assignment covers linear regression and logistic regression using discriminative methods

Statistics

CSE 6363: Machine Learning

Assignment 1

This assignment covers linear regression and logistic regression using discriminative methods.

  1. The Iris Dataset

The Iris flower data set (https://en.wikipedia.org/wiki/Iris_flower_data_set) was organized by Ronald Fisher in 1936. It is a commonly used dataset for introductory machine learning concepts. You will use this dataset for use with a classification AND regression task.

    1. Preparing the Data

To begin, load the data using scikit-learn. As we saw during class, the setosa samples are very clearly linearly separable given any combination of two features. However, the versicolor and virginica usually have some overlap.

In order to verify the models that you will create in the following two sections, you will need to take some portion of the dataset and reserve it for testing. Randomly select 10% of the dataset, ensuring an even split of each class. This will be your test set. The rest of the data will serve as your training set.

Create plots for the training set and test set across each pair of data using the same approach we covered in class. Save the plots and put them into your report.

  1. Linear Regression

Fit 12 linear regression models to the training data with parameters w = [w0,w1] for each one. For example, your first model may use sepal length as the input feature to predict sepal width and the second model would reverse that combination. Some of these input features will not be good predictors.

    1. Training

Your models should be trained using stochastic gradient descent with a batch size of 32. Use mean squared error as your loss function. For each model, train for n = 100 steps. As each model trains, record the loss average over the batch size against the current step number. Plot the loss against the step number and save it. This will go in your report.

 

To observe the effects of regularization, pick one of your trained models and inspect the weights. Train an identical model again, except this time you will add L2 regularization to the loss. Record the difference in parameters between the regularized and non-regularized model. In your report, include the weight values in this comparison.

    1. Testing

For each model you created, test its performance on unseen data by evaluating the mean squared error against the test dataset that you set aside previously. Based on these results, which input feature is most predictive of its corresponding output feature? Create a table of results that summarized the testing accuracy of each model and put it in your report.

  1. Logistic Regression

In this section, you will fit 6 logistic regression models to the training data with parameters w = [w0,w1,w2] for each one.

    1. Training

Train with a learning rate of 0.0001, 0.001, 0.01, and 0.1

Your models should be trained using stochastic gradient descent with a batch size of 32. Use mean squared error as your loss function with L2 regularization. For each model, train for n = 100 steps. As each model trains, record the loss average over the batch size against the current step number. Plot the loss against the step number and save it. This will go in your report.

Pick one of the feature combinations to test the effects of varying the learning rate α. For this model, train using the same configuration as before, but use a learning rate of 0.0001, 0.001, 0.01, and 0.1. Plot batch loss over time for each configuration and compare them. For this problem, which model converged the quickest? Place the plots and your conclusions in your report.

    1. Testing

For each model you created, test its performance on unseen data by evaluating the mean squared error against the test dataset that you set aside previously. Based on these results, which input feature is most predictive of its corresponding output feature? Create a table of results that summarized the testing accuracy of each model and put it in your report.

Submission

Create a zip file that includes all of your code as well as your report. The TA should be able to easily run the code to reproduce all plots and results. Include any additional instructions, if necessary.

Option 1

Low Cost Option
Download this past answer in few clicks

22.99 USD

PURCHASE SOLUTION

Already member?


Option 2

Custom new solution created by our subject matter experts

GET A QUOTE

Related Questions