Hello, dear friend, you can consult us at any time if you have any questions, add WeChat: THEend8_
Linear Regression — MACS 30121 - Computer Science with Social Science Applications I documentation
Getting started
Data
Introduction
Model tting
The linear_regression function
Task 0: The Model class
Representing datasets
Representing models
Testing your code
Task 1: Computing the coecient of Determination (R )2
Task 1
Task 2: Model evaluation using the Coecient of Determination (R )2
Task 2a
Task 2b
Evaluating your model output
Task 3: Building and selecting bivariate models
Task 4: Building models of arbitrary complexity
Feature standardization
Task 5: Training vs. testing data
Grading
Cleaning up
Submission
Linear Regression
In this assignment, you will t linear regression models and implement a few simple feature selection
algorithms. The assignment will give you experience with NumPy and more practice with using classes and
functions to support code reuse.
You must work alone on this assignment.
Getting started
Please follow the invitation URL provided on Ed Discussion to fetch the instructor's les.
You will nd the les you need for the programming assignment directly in the root of your repository,
including a README.txt le that explains what each le is. Make sure you read that le.
The pa5 directory contains the following les:
regression.py : Python le where you will write your code.
util.py : Python le with several helper functions, some of which you will need to use in
py y p , y
your code.
output.py : This le is described in detail in the “Evaluating your model output” section below.
test_regression.py : Python le with the automated tests for this assignment.
The pa5 directory also contains a data directory which, in turn, contains two sub-directories: city and
houseprice .