Recap: Car Listings
Part of the Statistics for ML section of Coddy's Machine Learning journey. Lesson 55 of 64.
Challenge
MediumA used car site preps listings for a price model. listings.csv has fuel, condition (fair, good, excellent), km and price. The program reads a fuel.
- Add
condition_score:fair1,good2,excellent3. - Add
mileage:lowup to 50000 km,midup to 120000,highup to 300000. - One-hot encode
fuelintocars(dtype=int). - Print the shape, cars per mileage band, and the read fuel's count, mean price and mean condition (2 decimals).
Five other listings become this table:
With the input hybrid, they print:
Shape: (5, 8)
mileage
low 1
mid 3
high 1
Name: count, dtype: int64
hybrid listings: 3
Mean price: 10500.0
Mean condition: 2.0Try it yourself
import pandas as pd
cars = pd.read_csv("listings.csv")
fuel = 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