मॉनिटरिंग और विज़ुअलाइज़ेशन

एंड-टू-एंड मशीन लर्निंग

Joshua Stapleton

Machine Learning Engineer

आगे क्या?

  • Trained, optimized, deployed, predicted... आगे क्या?
  • मॉनिटरिंग
    • परिणाम लॉग करना
    • परफॉर्मेंस का विज़ुअलाइज़ेशन

मशीन लर्निंग लाइफसाइकिल में मॉनिटरिंग चरण

एंड-टू-एंड मशीन लर्निंग

Python से लॉगिंग

import logging
import matplotlib.pyplot as plt

# Setting up basic logging configuration
logging.basicConfig(filename='predictions.log', level=logging.INFO)

# Make predictions on the test set and log the results
for i in range(X_test.shape[0]):
    instance = X_test[i,:].reshape(1, -1)
    prediction = model.predict(instance)
    logging.info(f'Inst. {i} - PredClass: {prediction[0]}, RealClass: {y_test[i]}')
एंड-टू-एंड मशीन लर्निंग

Python से लॉगिंग (जारी)

# Function to visualize the predictions from log
with open(logfile, 'r') as f:
    lines = f.readlines()
    predicted_classes = [int(line.split("Predicted Class: ")[1].split(",")[0]) \
        for line in lines]

    # Perform data analysis, visualization, etc.
    ...
  • Python लॉगिंग से मॉडल परफॉर्मेंस ट्रेस करें
एंड-टू-एंड मशीन लर्निंग

विज़ुअलाइज़ेशन

  • समय के साथ परफॉर्मेंस जाँचें
  • इनपुट/प्रेडिक्शन के कच्चे डेटा को इनसाइट्स में बदलें
import matplotlib.pyplot as plt

# Sample data: Random accuracy values for 12 months months = ["Jan", "Feb", "Mar", ...] accuracies = [0.86, 0.91, 0.74, ...]
plt.plot(months, accuracies, '-o') plt.title("Model Accuracy Over Months") plt.xlabel("Months") plt.ylabel("Accuracy") plt.show()
एंड-टू-एंड मशीन लर्निंग

विज़ुअलाइज़ेशन उदाहरण

12 महीनों में काल्पनिक मॉडल एक्यूरेसी दर्शाता एक लाइन ग्राफ

एंड-टू-एंड मशीन लर्निंग

लॉगिंग

  • घटनाओं की रिकॉर्डिंग

    • वैरिएबल वैल्यूज़, फंक्शन कॉल्स का ट्रैकिंग
    • एक्सीक्यूशन और परफॉर्मेंस से जुड़ी जानकारी
  • मॉनिटरिंग से ट्रैक करें:

    • Usage, परफॉर्मेंस, Errors/अनियमितताएँ
2023-08-04 09:15:20 [INFO] Model version 1.2.7 started

2023-08-04 09:15:45 [INFO] Preprocessing input data for prediction
2023-08-04 09:15:47 [DEBUG] Input data shape: (1, 12)
2023-08-04 09:15:48 [INFO] Making prediction
2023-08-04 09:15:50 [DEBUG] Output prediction: [0.78]
...
एंड-टू-एंड मशीन लर्निंग

विज़ुअलाइज़ेशन उदाहरण

  • हमारे मॉडल का उपयोगी मेट्रिक: समय के साथ balanced accuracy
  • ट्रेंड पहचानें, परफॉर्मेंस घटी तो देखें
  • क्या retraining ज़रूरी है, जाँचें
  • अपने use-case के लिए सही मेट्रिक्स चुनें

उदाहरण:

  • Balanced accuracy अपेक्षित वास्तविक-दुनिया दर के सापेक्ष बदलती है
  • संभावित समस्या का संकेत
  • चुनें और मूल्यांकन करें

मॉडल की balanced accuracy का विज़ुअलाइज़ेशन

एंड-टू-एंड मशीन लर्निंग

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

एंड-टू-एंड मशीन लर्निंग

Preparing Video For Download...