Recap: Ice Cream and Sun
Part of the Statistics for ML section of Coddy's Machine Learning journey. Lesson 34 of 64.
Challenge
MediumTime for the grid of every relationship. A beach kiosk logged 40 days in kiosk.csv: a date and six number columns. The program reads one column name.
- Print the other column most strongly related to it, sign ignored.
- Print the strongest pair of different columns, checking each pair once, in table order.
- Draw the matrix as a
coolwarmheatmap from -1 to 1 with a color bar, names as ticks, titledKiosk Correlations.
Round both r to 2 decimals. For a smaller log and the input temp_c:
Most related to temp_c: ice_creams (r = 0.87)
Strongest pair: visitors and ice_creams (r = 0.96)and the chart (Coddy then describes yours):
Try it yourself
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
kiosk = pd.read_csv("kiosk.csv")
column = input()
# Write your code below
All lessons in Statistics for ML
1Center and Spread
Mean and MedianPercentiles and QuartilesVariance and StdSample or Population?The Most Common ValueRecap: Delivery Times4Samples and Populations
Population and SampleSample Means VaryThe Sampling DistributionBigger Samples, Less NoiseRecap: Polling a Town2Distributions
Density HistogramsShapes of DataThe Normal CurveThe 68-95-99.7 RuleZ-ScoresRecap: Battery Life3Probability by Simulation
Probability as FrequencyThe Law of Large NumbersSums of DiceExpected ValueConditional ProbabilityRecap: Dice Stall Odds6Relationships
Reading Scatter PlotsCorrelationCorrelation MatrixCorrelation HeatmapsCorrelation Is Not CauseRecap: Ice Cream and SunPractice on your own: Online Python compiler