Regression Plots

इंटरमीडिएट Data Visualization with Seaborn

Chris Moffitt

Instructor

Bicycle Dataset

  • वॉशिंगटन DC की समेकित bicycle sharing डेटा
  • डेटा में शामिल:
    • रेंटल की संख्या
    • मौसम जानकारी
    • कैलेंडर जानकारी
  • क्या हम रेंटल संख्या का पूर्वानुमान लगा सकते हैं?
इंटरमीडिएट Data Visualization with Seaborn

regplot() से प्लॉटिंग

sns.regplot(data=df, x='temp', 
            y='total_rentals', marker='+')

Regression Plot

इंटरमीडिएट Data Visualization with Seaborn

residplot() से regression का मूल्यांकन

  • किसी मॉडल की फिट जाँचने के लिए residual plot उपयोगी है
  • Seaborn residplot फंक्शन से सपोर्ट करता है
sns.residplot(data=df, x='temp', y='total_rentals')

Residual Plot

इंटरमीडिएट Data Visualization with Seaborn

Polynomial regression

  • Seaborn order पैरामीटर से polynomial regression सपोर्ट करता है
sns.regplot(data=df, x='temp', 
            y='total_rentals', order=2)

Regression Plot

इंटरमीडिएट Data Visualization with Seaborn

Polynomial regression के साथ residplot

sns.residplot(data=df, x='temp', 
              y='total_rentals', order=2)

Residual Plot

इंटरमीडिएट Data Visualization with Seaborn

Categorical मान

sns.regplot(data=df, x='mnth', y='total_rentals',
            x_jitter=.1, order=2)

Residual Plot

इंटरमीडिएट Data Visualization with Seaborn

Estimators

  • कुछ स्थितियों में ट्रेंड हाइलाइट करने हेतु x_estimator उपयोगी होता है
sns.regplot(data=df, x='mnth', y='total_rentals',
            x_estimator=np.mean, order=2)

Residual Plot

इंटरमीडिएट Data Visualization with Seaborn

डेटा को बिन करना

  • x_bins से डेटा को discrete bins में बाँट सकते हैं
  • रिग्रेशन लाइन अब भी पूरे डेटा पर फिट होती है
sns.regplot(data=df,x='temp',y='total_rentals',
            x_bins=4)

Residual Plot

इंटरमीडिएट Data Visualization with Seaborn

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

इंटरमीडिएट Data Visualization with Seaborn

Preparing Video For Download...