Recap: Diabetes Data
Part of the Statistics for ML section of Coddy's Machine Learning journey. Lesson 60 of 64.
Challenge
MediumTen measurements of 442 diabetes patients, already scaled to small numbers around 0, and a label that is a number: how far the disease progressed a year later.
Load load_diabetes with as_frame=True. The program reads the feature a doctor asks about. Print:
- First look: patients and missing cells.
- The label's mean and median, to 1 decimal.
- The strongest feature and its signed r, to 2 decimals.
- A line from the asked feature: slope and intercept to 1 decimal, R squared to 2.
For a made-up clinic and the input age:
Patients: 300
Missing cells: 0
Progression: mean 118.6, median 118.0
Strongest feature: s2 (r = -0.75)
Line for age: slope 127.6, intercept 118.6
R squared: 0.01One feature explains a part. In section 3, a model will use all ten at once.
Try it yourself
import numpy as np
from sklearn.datasets import load_diabetes
feature = 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 Life8Comparing Groups
Box Plots by GroupDifference in MeansCould It Be Chance?P-ValuesThe t-TestRecap: A/B Test11Exploring a Dataset
A First LookEvery Feature at OnceFeatures Against the LabelTwo Best FeaturesRecap: Diabetes Data3Probability 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