Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Lernen Challenge: Building a Feature Pipeline for Customer Data | Section
Feature Engineering with PySpark
Abschnitt 1. Kapitel 4
single

single

Challenge: Building a Feature Pipeline for Customer Data

Swipe um das Menü anzuzeigen

Aufgabe

Wischen, um mit dem Codieren zu beginnen

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:

  1. Fill nulls in Delay and Length with 0;
  2. Apply StringIndexer to Airline – store the result in a column AIRLINE_IDX;
  3. Apply OneHotEncoder to AIRLINE_IDX – store the result in a column AIRLINE_VEC;
  4. Assemble Length, Time, and AIRLINE_IDX into a vector column FEATURES_RAW;
  5. Apply StandardScaler with withMean=True and withStd=True to FEATURES_RAW – store the result in FEATURES_SCALED;
  6. Store the final DataFrame in features_df and count its rows in features_count.

Print features_count and show all rows of Airline, AIRLINE_VEC, FEATURES_SCALED.

Lösung

Switch to desktopWechseln Sie zum Desktop, um in der realen Welt zu übenFahren Sie dort fort, wo Sie sind, indem Sie eine der folgenden Optionen verwenden
War alles klar?

Wie können wir es verbessern?

Danke für Ihr Feedback!

Abschnitt 1. Kapitel 4
single

single

Fragen Sie AI

expand

Fragen Sie AI

ChatGPT

Fragen Sie alles oder probieren Sie eine der vorgeschlagenen Fragen, um unser Gespräch zu beginnen

some-alt