Explainable AI with Linear Models
Benefits of Linear Models:
- Starting with linear models offers simplicity, aiding in understanding and establishing a baseline for comparison with more complex models.
Causality Caution:
- Avoid making causal conclusions, as relationships may involve proxy variables. Beware of confirmation bias and aim for objective analysis.
Data Exploration:
- Investigate correlation (multicollinearity) and normality of features (distribution of features).
- Detect outliers using Z-score and Interquartile Range (IQR).
- Conduct Exploratory Data Analysis (EDA) including correlation and scatter plots.
Feature Engineering:
- Encode categorical features.
- Consider inverses of features and logical ratios for intuitive feature construction.
- Discretize continuous features to transform them into categorical features.
Finding Non-Linear Relationships:
- Utilize domain knowledge, data exploration (e.g., correlations), and non-linear models (e.g., Random Forest, XGBoost, DNN) to identify patterns.
Feature Selection:
- Use correlation-based selection and Variance Inflation Factor (VIF) to identify and remove redundant features.
- Eliminate irrelevant features lacking predictive power.
- Evaluate predictive power through feature groups and variable clustering methods.
Considerations in Feature Selection:
- Group features based on similarity.
- Use variable clustering methods like k-means or hierarchical clustering.
- Ensure data authenticity and availability in production.
- Validate feature predictiveness across time.
- Prioritize interpretable features and ensure legal and ethical compliance.
Hierarchical Clustering for Feature Selection:
- Employ hierarchical clustering to group features based on correlations while retaining interpretability.
Choosing Model:
- Consider linear and polynomial models.
Training Model:
- Choose a cost function (e.g., LASSO for MSE with regularization).
- Adjust learning rate and number of epochs.
- Specify polynomial degree for polynomial models (e.g., 2 or 3).
Model Evaluation:
- Assess model performance using metrics like MSE, R-squared, and RMSE.
- Validate model robustness through cross-validation.
- Analyze learning curves and residuals to understand model behavior and shortcomings.
- Compare linear model results with other models to ensure optimal choice.
Visualizing Linear Regression Performance:
- Utilize scatter plots, correlation heatmaps, weight plots, mean effect plots, individual effect plots, trend effect plots, partial dependence plots, and SHAP values to interpret model performance.
Mitigating Confirmation Bias:
- Employ multiple Explainable AI (XAI) methods to reduce confirmation bias, providing transparency and aiding in understanding model decisions.