Regression model train করার পরে diagnostics ব্যবহার করে দেখতে হয় model-এর assumptions এবং potential problems কেমন।

Residual Plot

সাধারণভাবে predicted value-এর বিপরীতে residual plot করা হয়।

Ideal ক্ষেত্রে residuals কোনো clear pattern ছাড়া roughly random cloud-এর মতো হওয়া উচিত।

যদি clear curve দেখা যায়:

Possible nonlinear relationship

আর যদি spread prediction-এর সঙ্গে বাড়তে থাকে:

Possible heteroscedasticity

Q-Q Plot

Q-Q plot residual distribution normal distribution-এর কাছাকাছি কিনা visually inspect করতে সাহায্য করে।

যদি points roughly straight line follow করে, normality assumption-এর সঙ্গে data বেশি consistent হতে পারে।

VIF

VIF = Variance Inflation Factor।

একটি predictor অন্য predictors-এর মাধ্যমে কতটা explain করা যায়, তার ভিত্তিতে multicollinearity diagnose করতে VIF ব্যবহার করা হয়।

$$\text{ VIF\_j } = \frac{1}{1 - R_{j}^{2}}$$

যেখানে $R_{j}^{2}$ হলো predictor $j$-কে অন্য predictors দিয়ে predict করার R²।

VIF অনেক বেশি হলে:

Possible multicollinearity

indicate করতে পারে।

Cook’s Distance

কোনো একটি observation model-এর fitted coefficients-কে কতটা influence করছে তা detect করতে Cook’s Distance ব্যবহার করা যায়।

যদি একটি observation বাদ দিলে model-এর fitted result উল্লেখযোগ্যভাবে পরিবর্তিত হয়, তাহলে সেটি একটি influential observation হতে পারে।