Salary Prediction. Stage 3/5

Linear regression with many independent variables

Report a typo

Description

In the previous stages, you used only one independent variable. Now, your task is to include other variables into a model.

Objectives

  1. Read the data. For downloading the dataset refer to Stage 1;
  2. Load data with pandas.read_csv;
  3. Make X a DataFrame with predictors and y a series with a target. To make X, drop target variable from the data. All other variables leave unchanged.
  4. Split the predictors and target into training and test sets. Use test_size=0.3 and random_state=100 — they guarantee that the results will be the same as the test system expects.
  5. Fit the model predicting salary based on all other variables;
  6. Print the model coefficients separated by a comma.

Example

Example 1: program output

17.54323e+10, 34543.56776e+05, 12.345, -23413.00987e+13, 0
Write a program
IDE integration
Checking the IDE status
___

Create a free account to access the full topic