Seção 1. Capítulo 9
single
Challenge: Preparing a Dataset for Machine Learning
Deslize para mostrar o menu
Tarefa
Deslize para começar a programar
You are given a flights dataset as a list of rows. Load it into a DataFrame using createDataFrame and prepare it for a binary classification task – predicting whether a flight is delayed (Delay == 1). Complete all steps and store results in the specified variables:
- Fill nulls in
DelayandLengthwith0; - Add a binary label column
LABEL–1ifDelay == 1, otherwise0; - Add
IS_WEEKEND–1ifDayOfWeek >= 6, otherwise0; - Apply
StringIndexertoAirline→AIRLINE_IDX; - Assemble
Length,Time,IS_WEEKEND, andAIRLINE_IDXinto a vector columnFEATURES; - Store the final DataFrame in
ml_dfand count its rows inml_count.
Print ml_count and show all rows of LABEL, AIRLINE_IDX, FEATURES.
Solução
Tudo estava claro?
Obrigado pelo seu feedback!
Seção 1. Capítulo 9
single
Pergunte à IA
Pergunte à IA
Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo