Seksjon 1. Kapittel 4
single
Challenge: Building a Feature Pipeline for Customer Data
Sveip for å vise menyen
Oppgave
Sveip for å begynne å kode
You are given a flights dataset as a list of rows. Load it into a DataFrame using createDataFrame and apply the encoding and scaling techniques from the previous chapters. Store results in the specified variables:
- Fill nulls in
DelayandLengthwith0; - Apply
StringIndexertoAirline– store the result in a columnAIRLINE_IDX; - Apply
OneHotEncodertoAIRLINE_IDX– store the result in a columnAIRLINE_VEC; - Assemble
Length,Time, andAIRLINE_IDXinto a vector columnFEATURES_RAW; - Apply
StandardScalerwithwithMean=TrueandwithStd=TruetoFEATURES_RAW– store the result inFEATURES_SCALED; - Store the final DataFrame in
features_dfand count its rows infeatures_count.
Print features_count and show all rows of Airline, AIRLINE_VEC, FEATURES_SCALED.
Løsning
Alt var klart?
Takk for tilbakemeldingene dine!
Seksjon 1. Kapittel 4
single
Spør AI
Spør AI
Spør om hva du vil, eller prøv ett av de foreslåtte spørsmålene for å starte chatten vår