Skip to content
C

Problem 1: Fit a Multiple Linear Regression Model

Easypython

Problem Description

Write a Python program that fits a Multiple Linear Regression model using two features (size and number of rooms) to predict house price, and prints the learned coefficients and intercept.

Input

A dataset with two feature columns and one target column.

Output

The learned coefficients and intercept.

Constraints

  • At least 5 data points.

Example Input

text
size=[10,15,20,25,30], rooms=[2,3,3,4,4], price=[200,250,280,340,360]

Example Output

text
Intercept: 45.71 Coefficients: [8.86, 8.00]

Concepts Covered

LinearRegression, multiple features, .coef_, .intercept_.

Input (stdin)

Output

Run your code to see output here...