Regression Model Development

Job ID: 33145213

Budget: $10 – $30 USD

In this assignment, you are tasked with using the information in our course case to build a predictive model on a continuous response variable (Y-variable). This assignment encompasses feature engineering, model preparation, variable selection, and model development.
A) Deliverable:

Jupyter notebook



B) Modeling Criteria and Violation Penalties

Your deliverable needs to meet the following criteria. Failure to meet the coding criteria listed below will result and a reduction in your model points score.



Your grade will be determined by the performance of your final model as follows:



Final Model Points = Final Model R-Square on the Test Set – Modeling Violation Penalties



Criterion 1 – Train-Test Gap

Gap between training and testing scores must be less than or equal to 0.05. In train-test split, make sure your random_state is set to 219 and your test_size is set to 0.25.

Criterion 2 – Response Variable Usage

The response variable cannot be used in any form as an explanatory variable (the y-variable cannot be used on the X-side). This includes logarithmic versions of the y-variable, and features that were engineered using the y-variable.


Criterion 3 – Model Types

Model types are appropriate for the task at hand and come from scikit-learn (other packages and/or engines are not permitted). However, you may use statsmodels to evaluate your model statistics, as long as your final model is in scikit-learn.



Permitted Model Types

OLS Regression (standard linear regression)
Lasso Regression
Bayesian Automatic Relevance Determination (ARD)
K-Nearest Neighbors Regression (KNN)


Note that you are permitted to adjust the optional arguments of the permitted model types.



Violation Penalty

Final models that are not in the list of permitted model types will be discarded and the last appropriate model that ran in your code will be used as your final model. Final model points will be reduced by 0.025.



Criterion 4 – Code is Well-Commented and Runs Without Errors

For this assignment, aim for a minimum one quality comment for every 5 lines of code.


Criterion 5 – Code Processing Time

Your code must process from beginning to end in 60 seconds or less, based on your computer’s processing speed. There is no requirement to calculate processing time in your code as this can be done by hand (your code is very likely to be significantly under the processing time limit).



Criterion 6 – Model Output

Model results are outputted as a dynamic string (i.e., f-string) at the end of your script. This must be the very last thing that your Jupyter Notebook outputs. DO NOT write this in a markdown cell or export as an Excel file. This must be a dynamic string.



Output table of candidate models is well-formatted and contains the following information:

Model Type
Training Score
Testing Score
Train-Test Gap
It is clear which model is your final model (label it accordingly). The final model MUST be labeled in your dynamic string to meet this criterion.

Criterion 7 – X-variable usage

The original and logarithmic versions of an x-variable may not be used in the same model. This does not include engineered features based on these variables.

Criterion 8 - Full Dataset Usage

You are not permitted to remove or modify any observations from the original dataset, with the exception of imputing missing values (you are not permitted to remove observations with missing values). Also, your Jupyter Notebook must be able to be run from the original dataset (no feature engineering or alterations in Excel or other tools are permitted).
Related categories: Python Linear Regression