74803025

pdf

School

Collin County Community College District *

*We aren’t endorsed by this school

Course

2301

Subject

Computer Science

Date

Feb 20, 2024

Type

pdf

Pages

2

Uploaded by CommodoreLightning4952

Report
Spring’24: CS 4375–002 Homework 2 January 30, 2024 Requirements: Deadline for submission: Feb-14-2024 . All assignments MUST have your name, student ID, course name/number at the beginning of your docu- ments. For each of the four questions, please write all the codes in one Jupyter notebook and run the codes to display the results in the notebook before you save the notebook (ipynb file). Please use markdown cells ( https://www.tutorialspoint.com/jupyter/jupyter_notebook_markdown_cells.htm ) to write text to explain or discuss your codes/results. About how to create and save a jupyter notebook with Anaconda Navigator, check the following youtube video: https://www.youtube.com/watch?v=-MyjG00la2k As there are four questions in total, you will need to submit four Jupyter notebooks. You are allowed to extend the Python scripts in the Jupyter notebooks that I posted on eLearning to answer these questions. Please zip the Jupyter notebooks and other data files and submit the zip file. For the assignments in Q2 and Q4, you are required to implement the gradient descent algorithms indepen- dently, without relying on pre-existing libraries or optimization solvers. This homework assignment has four questions stated as follows: Q1 (Linear Regression): Write Python codes in a Jupyter notebook that use the Python library (sklearn.linear model) to train a linear regression model for the Boston housing dataset: https://towardsdatascience.com/linear-regression-on-boston-housing-dataset-f409b7e4a155 . Split the dataset to a training set (70% samples) and a testing set (30% samples). Print the root mean squared errors (RMSE) on the training and testing sets in the Jupyter notebook. Q2 (Linear Regression) Write Python scripts in a Jupyter notebook that implement the gradient descent algorithm from scratch to train a linear regression model for the Boston housing data set. https://towardsdatascience.com/linear-regression-on-boston-housing-dataset-f409b7e4a155 Split the dataset to a training set (70% samples) and a testing set (30% samples). Print the root mean squared errors (RMSE) on the training and testing sets in the Jupyter notebook. Q3 (Logistic Regression): Write Python scripts in a Jupyter notebook that use the Python library (sklearn.linear model) to train a logistic regression model for the Titanic dataset: https://blog.goodaudience.com/machine-learning-using-logistic-regression-in-python-with-code- ab3c7f5f3bed . Split the dataset into a training set (80% samples) and a testing set (20% samples). Print the overall classification accuracies on the training and testing sets and report the precision, recall, and F-measure scores for each of the two classes on the training and testing sets in the Jupyter notebook. 1
Q4 (Logistic Regression): Write Python scripts in a Jupyter notebook that implement the gradient descent algorithm from scratch to train a logistic regression model for the Titanic dataset: https://blog.goodaudience.com/machine-learning-using-logistic-regression-in-python-with-code- ab3c7f5f3bed . Split the dataset into a training set (80% samples) and a testing set (20% samples). Print the overall classification accuracies on the training and testing sets and print the precision, recall, and F-measure scores for each of the two classes on the training and testing sets in the Jupyter Notebook. 2
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help