Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
学ぶ Challenge: Predicting Flight Delays | Section
Machine Learning with PySpark
セクション 1.  5
single

single

Challenge: Predicting Flight Delays

メニューを表示するにはスワイプしてください

タスク

スワイプしてコーディングを開始

You are given a flights dataset as a list of rows. Load it into a DataFrame using createDataFrame and train a binary classification model to predict 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 LABEL column – 1.0 if Delay == 1, otherwise 0.0;
  3. Add IS_WEEKEND1 if DayOfWeek >= 6, otherwise 0;
  4. Split into train (80%) and test (20%) with seed=42;
  5. Build a Pipeline with StringIndexer on Airline, VectorAssembler on ["Length", "Time", "IS_WEEKEND", "AIRLINE_IDX"], and RandomForestClassifier with numTrees=10, maxDepth=3, seed=42;
  6. Fit the pipeline and generate predictions on the test set – store in predictions;
  7. Compute AUC-ROC – store in auc_roc (rounded to 4 decimal places);
  8. Compute accuracy – store in accuracy (rounded to 4 decimal places).

Print both metrics.

解答

Switch to desktop実践的な練習のためにデスクトップに切り替える下記のオプションのいずれかを利用して、現在の場所から続行する
すべて明確でしたか?

どのように改善できますか?

フィードバックありがとうございます!

セクション 1.  5
single

single

AIに質問する

expand

AIに質問する

ChatGPT

何でも質問するか、提案された質問の1つを試してチャットを始めてください

some-alt