Skip to content
C

Problem 2: Predict New Values

Easypython

Problem Description

Write a Python program that trains a Linear Regression model and then uses it to predict the output for 3 new, unseen input values.

Input

Training data (X, y), and 3 new input values to predict.

Output

The predicted values for the 3 new inputs.

Constraints

  • None specific.

Example Input

text
X = [[1],[2],[3],[4]], y = [3,5,7,9], new_values = [[5],[6],[7]]

Example Output

text
Predictions: [11. 13. 15.]

Concepts Covered

.predict().

Input (stdin)

Output

Run your code to see output here...