शुरू करेंमुफ़्त में शुरू करें

Decision Tree बनाइए

अब जब आपने flights डेटा को training और testing सेट्स में बाँट लिया है, तो आप training सेट का उपयोग करके एक Decision Tree मॉडल fit कर सकते हैं.

डेटा flights_train और flights_test के रूप में उपलब्ध है.

नोट: मॉडल को train होने में कुछ सेकंड लगेंगे… कृपया धैर्य रखें!

यह अभ्यास पाठ्यक्रम का हिस्सा है

PySpark के साथ Machine Learning

पाठ्यक्रम देखें

अभ्यास निर्देश

  • Decision Tree क्लासिफ़ायर बनाने वाली क्लास इम्पोर्ट करें.
  • एक क्लासिफ़ायर ऑब्जेक्ट बनाएँ और उसे training डेटा पर fit करें.
  • testing डेटा के लिए प्रेडिक्शन करें और प्रेडिक्शन पर नज़र डालें.

इंटरैक्टिव व्यावहारिक अभ्यास

इस अभ्यास को इस नमूना कोड को पूरा करके आज़माएँ।

# Import the Decision Tree Classifier class
from pyspark.ml.____ import ____

# Create a classifier object and fit to the training data
tree = ____()
tree_model = tree.____(____)

# Create predictions for the testing data and take a look at the predictions
prediction = tree_model.____(____)
prediction.select('label', 'prediction', 'probability').show(5, False)
कोड संपादित करें और चलाएँ