1

JSON Parsing for Linear Regression

Unsolved
Data Wrangling
Supervised

Difficulty: 3 | Problem written by peter.washington
Implement a linear regression model used to predict the monthly premium someone is willing to pay for a health insurance policy. The input values are:

  • Credit_Score - a value between 0 and 800
  • Gender - male (0) or female (1)
  • Age (in years) - a value between 18 and 100
  • Income_Group - a value representing the income group of the customer, with values ranging from 1 to 10

Here is the model:

Expected_Health_Premium = exp(0.05 * Gender + 0.003 * Credit_Score + 0.008 * Age + 0.01 * Income_Group + 2.1)

The input to the model will be a JSON string which you must parse.

Sample Input:
<class 'dict'>
json_data: {"Credit_Score": 800, "Gender": "Female", "Age": 20, "Income_Group": 7}

Expected Output:
<class 'float'>
119.10435004481377
Ready.

Input Test Case

Please enter only one test case at a time
numpy has been already imported as np (import numpy as np)