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

वैरिएबल्स का क्रम ढूँढना

Forward stepwise variable selection प्रक्रिया खाली वैरिएबल सेट से शुरू होती है और प्रीडिक्टर्स को एक-एक करके जोड़ती है. हर स्टेप में वह प्रीडिक्टर चुना जाता है जिसका AUC, current वैरिएबल्स के साथ मिलकर, सबसे अधिक हो.

इस अभ्यास में आप forward stepwise variable selection प्रक्रिया को लागू करना सीखेंगे. इसके लिए आप next_best फंक्शन का उपयोग कर सकते हैं, जिसे आपके लिए पहले से इम्प्लिमेंट किया गया है. इसे इस प्रकार इस्तेमाल किया जा सकता है:

next_best(current_variables,candidate_variables,target,basetable)

जहाँ current_variables उन वैरिएबल्स की लिस्ट है जो पहले से मॉडल में हैं, और candidate_variables वह लिस्ट है जिन वैरिएबल्स को अगला जोड़ा जा सकता है.

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

Python में प्रिडिक्टिव एनालिटिक्स परिचय

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

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

  • next_best फंक्शन का उपयोग करके अगला सर्वोत्तम वैरिएबल निकालें और उसे next_variable में असाइन करें.
  • current_variables लिस्ट को अपडेट करें.
  • candidate_variables लिस्ट को अपडेट करें.

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

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

# Find the candidate variables
candidate_variables = list(basetable.columns.values)
candidate_variables.remove("target")

# Initialize the current variables
current_variables = []

# The forward stepwise variable selection procedure
number_iterations = 5
for i in range(0, number_iterations):
    next_variable = ____(____, ____, ["target"], basetable)
    current_variables = current_variables + [____]
    candidate_variables.remove(____)
    print("Variable added in step " + str(i+1)  + " is " + next_variable + ".")
print(current_variables)
कोड संपादित करें और चलाएँ