Define the linear regression function in Python to make predictions.
What is the Calorie Burnage for the following scenarios?
- Average pulse = 110 and duration = 60 minutes
- Average pulse = 140 and duration = 45 minutes
- Average pulse = 175 and duration = 20 minutes
Example
def Predict_Calorie_Burnage(Average_Pulse, Duration): return(3.1695*Average_Pulse + 5.8434 * Duration – 334.5194)
print(Predict_Calorie_Burnage(110,60)) print(Predict_Calorie_Burnage(140,45)) print(Predict_Calorie_Burnage(175,20)) |
The results are:
- For an average pulse of 110 and a training duration of 60 minutes, the Calorie Burnage is 365 calories.
- For an average pulse of 140 and a training duration of 45 minutes, the Calorie Burnage is 372 calories.
- For an average pulse of 175 and a training duration of 20 minutes, the Calorie Burnage is 337 calories.
Access the Coefficients
Consider the coefficients:
- Calorie Burnage increases by 3.17 for every 1-unit increase in Average Pulse.
- Calorie Burnage increases by 5.84 for every 1-unit increase in Duration.
Access the P-Value
Examine the P-values for each coefficient:
- The P-value for Average Pulse, Duration, and the Intercept is 0.00.
- Since the P-value is less than 0.05, it is statistically significant for all variables.
Thus, we can conclude that Average Pulse and Duration are related to Calorie Burnage.