Multiple Linear Regression with Feature Selection
HardRegressionFeature SelectionModel FittingStatistical Testing
Implement multiple linear regression from scratch and explore feature selection techniques.
Problem:
Implement multiple linear regression from scratch and explore feature selection techniques.
Examples:
Input: X, y = make_regression(n_samples=100, n_features=3)
coefficients = calculate_coefficients(X, y)
Output: R-squared: 0.85
Adjusted R-squared: 0.84
Multiple regression on synthetic data
Input: X, y = fetch_california_housing(return_X_y=True)
selected = forward_selection(X, y)
Output: Selected features: [0, 4, 7]
R-squared improved from 0.54 to 0.61
Feature selection on California housing dataset
Constraints:
- Must handle multicollinearity
- Must calculate adjusted R-squared
- Must implement statistical tests
Code Editorpython
Run your code to see the output here.
Output
Run your code to see the output here.