Skip to content
C

Problem 4: Tune Regularization Strength (alpha) for Ridge Regression

Easypython

Problem Description

Write a Python program that uses GridSearchCV to find the best alpha value for a Ridge regression model from a list of candidates, evaluated using Cross-Validation.

Input

A regression dataset and a list of candidate alpha values.

Output

The best alpha value and its Cross-Validation score.

Constraints

  • At least 10 data points.

Example Input

text
(A regression dataset, alpha candidates: [0.1, 1, 10, 100])

Example Output

text
Best alpha: 10 Best score: 0.91

Concepts Covered

GridSearchCV, Ridge, regression scoring.

Input (stdin)

Output

Run your code to see output here...