Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Aprenda Challenge: Preparing a Dataset for Machine Learning | Section
Feature Engineering with PySpark
Seção 1. Capítulo 9
single

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:

  1. Fill nulls in Delay and Length with 0;
  2. Add a binary label column LABEL1 if Delay == 1, otherwise 0;
  3. Add IS_WEEKEND1 if DayOfWeek >= 6, otherwise 0;
  4. Apply StringIndexer to AirlineAIRLINE_IDX;
  5. Assemble Length, Time, IS_WEEKEND, and AIRLINE_IDX into a vector column FEATURES;
  6. Store the final DataFrame in ml_df and count its rows in ml_count.

Print ml_count and show all rows of LABEL, AIRLINE_IDX, FEATURES.

Solução

Switch to desktopMude para o desktop para praticar no mundo realContinue de onde você está usando uma das opções abaixo
Tudo estava claro?

Como podemos melhorá-lo?

Obrigado pelo seu feedback!

Seção 1. Capítulo 9
single

single

Pergunte à IA

expand

Pergunte à IA

ChatGPT

Pergunte o que quiser ou experimente uma das perguntas sugeridas para iniciar nosso bate-papo

some-alt