Skip to content

Assignment two#2

Merged
cvasoff merged 5 commits intomainfrom
assignment_two
Dec 5, 2025
Merged

Assignment two#2
cvasoff merged 5 commits intomainfrom
assignment_two

Conversation

@cvasoff
Copy link
Owner

@cvasoff cvasoff commented Nov 29, 2025

What changes are you trying to make? (e.g. Adding or removing code, refactoring existing code, adding reports)

I am adding and/or replacing existing code to fit a multivariable linear regression model (mlm) on a provided dataset. Specifically, I am inspecting the dataset structure, responding to a few conceptual questions in markdown, splitting the dataset into train and test sets, fitting an mlm, predicting the mpg for each row in the dataset using the test data, and finally, assessing the mlm prediction test error using the Root Mean Squared Prediction Error (RMSPE) measure to determine the average prediction accuracy in the test set.

What did you learn from the changes you have made?

I learned how to execute simple scikit-learn code to fit a multivariable linear regression model on a training set using Python and evaluate the model on test data.

Was there another approach you were thinking about making? If so, what approach(es) were you thinking of?

Not for this assignment.

Were there any challenges? If so, what issue(s) did you face? How did you overcome it?

I got stuck in two places:
a) I needed to reiterate my list of predictor (feature) variables throughout my coding "[["cylinders", "displacement", "horsepower", "weight", "acceleration", "model_year"]]", which stumped me initially when I attempted to refer to using an (uninitialized) variable name instead of directly listing them in the DataFrame dataset.
b) I also needed to reread the coding provided for the DataFrame creation step. I initially used the provided "lm" coding instead of "mlm" coding. The error message for the "lm" coding indicated an incorrect array size, suggesting that the code was not generating slope coefficients for all the listed predictor variables. I rechecked the Regression-2 notebook and adjusted my code.

How were these changes tested?

By running the code to obtain error-free (and reasonable) output.

A reference to a related issue in your repository (if applicable)

Checklist

  • [x ] I can confirm that my changes are working as intended

Copy link

@anjali-deshpande-hub anjali-deshpande-hub left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well done!

Just one observation: this PR should only contain updates to assignment_2.ipynb. In the future, please include only the changes relevant to the PR.

@cvasoff cvasoff merged commit d9d73bb into main Dec 5, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants