From 6334166d923274ba38d80b31bf0e20f0700112f6 Mon Sep 17 00:00:00 2001 From: Jim Bennett Date: Tue, 14 Feb 2023 17:39:48 -0800 Subject: [PATCH] Adding the call to the `corr` function The README is missing the call to the `corr` function that is in the final notebook. --- 2-Regression/3-Linear/README.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/2-Regression/3-Linear/README.md b/2-Regression/3-Linear/README.md index 63596de49..8601abde3 100644 --- a/2-Regression/3-Linear/README.md +++ b/2-Regression/3-Linear/README.md @@ -103,7 +103,14 @@ This suggests that there should be some correlation, and we can try training lin Scatter plot of Price vs. Day of Year -It looks like there are different clusters of prices corresponding to different pumpkin varieties. To confirm this hypothesis, let's plot each pumpkin category using a different color. By passing an `ax` parameter to the `scatter` plotting function we can plot all points on the same graph: +Let's see if there is a correlation using the `corr` function: + +```python +print(new_pumpkins['Month'].corr(new_pumpkins['Price'])) +print(new_pumpkins['DayOfYear'].corr(new_pumpkins['Price'])) +``` + +It looks like the correlation is pretty small, -0.15 by `Month` and -0.17 by the `DayOfMonth`, but there could be another important relationship. It looks like there are different clusters of prices corresponding to different pumpkin varieties. To confirm this hypothesis, let's plot each pumpkin category using a different color. By passing an `ax` parameter to the `scatter` plotting function we can plot all points on the same graph: ```python ax=None