सटीकता मैट्रिक्स: रिग्रेशन मॉडल्स

Python में Model Validation

Kasey Jones

Data Scientist

रिग्रेशन मॉडल्स

रिग्रेशन मॉडल्स सतत वैरिएबल्स को प्रेडिक्ट करते हैं। जैसे पॉइंट्स की संख्या, गैलन की संख्या, या पप्पी की संख्या!

Python में Model Validation

मीन एब्सोल्यूट एरर (MAE)

 

$$ MAE = \frac{\sum_{i=1}^{n} |y_i - \hat{y}_i|}{n} $$

  • सबसे सरल और सहज मैट्रिक
  • सभी पॉइंट्स को समान मानता है
  • आउटलायर्स से कम प्रभावित
Python में Model Validation

मीन स्क्वेयर्ड एरर (MSE)

 

$$ MSE = \frac{\sum_{i=1}^{n} (y_i - \hat{y}_i) ^2}{n} $$

  • सबसे व्यापक रूप से उपयोग किया जाने वाला रिग्रेशन मैट्रिक
  • आउटलायर एरर्स कुल एरर में अधिक योगदान देते हैं
  • रैंडम फैमिली रोड ट्रिप्स से प्रेडिक्शन एरर बड़े हो सकते हैं
Python में Model Validation

MAE बनाम MSE

  • सटीकता मैट्रिक्स हमेशा एप्लिकेशन-विशिष्ट होते हैं
  • MAE और MSE अलग इकाइयों में होते हैं, इनकी तुलना न करें
Python में Model Validation

मीन एब्सोल्यूट एरर

rfr = RandomForestRegressor(n_estimators=500, random_state=1111)
rfr.fit(X_train, y_train)
test_predictions = rfr.predict(X_test)

sum(abs(y_test - test_predictions))/len(test_predictions)
9.99
from sklearn.metrics import mean_absolute_error
mean_absolute_error(y_test, test_predictions)
9.99
Python में Model Validation

मीन स्क्वेयर्ड एरर

sum(abs(y_test - test_predictions)**2)/len(test_predictions)
141.4
from sklearn.metrics import mean_squared_error
mean_squared_error(y_test, test_predictions)
141.4
Python में Model Validation

डेटा के सबसेट पर सटीकता

chocolate_preds = rfr.predict(X_test[X_test[:, 1] == 1])
mean_absolute_error(y_test[X_test[:, 1] == 1], chocolate_preds)
8.79
nonchocolate_preds = rfr.predict(X_test[X_test[:, 1] == 0])
mean_absolute_error(y_test[X_test[:, 1] == 0], nonchocolate_preds)
10.99
Python में Model Validation

अभ्यास करते हैं!

Python में Model Validation

Preparing Video For Download...