Skip to content
Pusat Penelitian, Pengabdian kepada Masyarakat dan Publikasi Internasional
twitter
youtube
instagram
Pusat Penelitian, Pengabdian kepada Masyarakat dan Publikasi Internasional
Call Support 0822-7473-7806
Email Support [email protected]
Location Jl. Kolam No. 1 Medan Estate
  • Beranda
  • Tentang
    • Profil
    • Visi dan Misi
    • Struktur Organisasi
    • Pimpinan Pusat
    • Program Kerja
    • Sasaran, Program Strategis dan IK
  • Berita Kegiatan
  • Layanan & Informasi
    • Aplikasi
      • UMA
        • Penjaminan Mutu
        • Himpunan Aplikasi Online
        • Jurnal Ilmiah Online
        • Repositori UMA
        • Open Access Public Catalog
      • Unit
        • Aplikasi Penelitian & Pengabdian (LIPAN)
        • SWAMP-D
        • SUSITAO
        • SINTA Verifikator
        • BIMA Kemdiktisaintek
    • Arsip Digital
    • Helpdesk
    • Pendanaan
      • Penelitian
        • Penelitian Pendanaan Nasional
        • Penelitian Kerjasama Internasional
      • Pengabdian Kepada Masyarakat
        • PKM Pendanaan Nasional
    • Publikasi
      • Internasional Bereputasi
    • Reviewer Penelitian dan PKM
  • Kerjasama
  • Jadwal Kegiatan

SHAP Values: Making Machine Learning Models Explainable

Posted on June 11, 2025June 29, 2025 by Fachrur Rozi
0

In the age of artificial intelligence, machine learning models are often treated as black boxes—delivering high accuracy, yet offering little transparency. But in many industries such as healthcare, finance, and law, knowing why a model makes a certain prediction is just as important as the prediction itself. This is where SHAP values come in.


🔍 What are SHAP Values?

SHAP (SHapley Additive exPlanations) is a game-theory-based approach to explain the output of any machine learning model. It attributes a prediction to each input feature, showing how much each feature contributed to the final output.

SHAP values help answer questions like:

  • Why did the model approve this loan?
  • Which features increased the risk prediction?
  • What variables most influence a decision?

🎯 Why SHAP?

  • Model-Agnostic: Works with any ML model (XGBoost, Random Forest, Neural Nets, etc.)
  • Fair Attribution: Based on Shapley values from cooperative game theory.
  • Local & Global Interpretability:
    • Local: Explains a single prediction.
    • Global: Shows overall feature importance across the dataset.

🧠 Concept Behind SHAP: Shapley Values

From game theory, Shapley values distribute a reward (prediction) among a group of players (features) based on their contribution. In machine learning:

  • Each feature is a player.
  • The model’s prediction is the payout.
  • SHAP calculates each feature’s average contribution across all possible combinations of features.

Though computing exact Shapley values is computationally expensive, SHAP provides efficient approximations for practical use.


🛠️ How to Use It in Python (with XGBoost Example)

import shap
import xgboost
from sklearn.datasets import load_boston

# Load data and train model
X, y = load_boston(return_X_y=True)
model = xgboost.XGBRegressor().fit(X, y)

# Initialize SHAP explainer
explainer = shap.Explainer(model)
shap_values = explainer(X)

# Visualize explanation for one prediction
shap.plots.waterfall(shap_values[0])

# Summary plot (global importance)
shap.plots.beeswarm(shap_values)

📊 SHAP Visualizations

  1. Waterfall Plot – Shows how features push a prediction up or down.
  2. Beeswarm Plot – Displays global feature importance and impact direction.
  3. Force Plot – Interactive visualization of individual predictions.
  4. Dependence Plot – Shows interaction between features.

💡 Use Cases

Industry Use Case
Finance Loan approval reasoning and fairness checks
Healthcare Diagnosis explanation and medical risk assessment
Insurance Claim prediction justification
Legal / HR Discrimination audits in automated decision-making
Marketing Customer churn analysis

⚠️ Limitations and Considerations

  • Computationally intensive for large datasets
  • Can be misinterpreted without domain knowledge
  • Must be used with well-trained models—SHAP explains, but doesn’t fix bias

✅ Benefits of SHAP

  • Builds trust in AI systems
  • Enables debugging and model refinement
  • Improves regulatory compliance (e.g., GDPR, AI ethics)
  • Enhances communication between data scientists and stakeholders

🧾 Conclusion

SHAP values bridge the gap between model accuracy and interpretability. By showing how each feature influences a prediction, they empowers data scientists, decision-makers, and even end-users to trust, audit, and understand machine learning models. As explainable AI becomes increasingly important, it will remain a cornerstone of transparent, responsible data science.


Would you like a walkthrough using your own dataset or model? I can also help compare it with other explainability tools like LIME or permutation importance.

Tags: Digital University, Dosen Terbaik, Green University, Kampus Terakreditasi, Kampus Unggulan, Mahasiswa Berprestasi, Penelitian, Sustainable University, UMA Terbaik, Universitas Swasta, Universitas Terbaik

Berita Terbaru
Menuju Pendanaan Riset Nasional, UMA Gelar Bimtek RIIM Kompetisi 2026 Bersama BRIN
Medan, 11 Juni 2026 – Universitas Medan Area (UMA) melalui Pusat Penelitian, Pengabdian kepada Masyarakat, dan Publikasi Internasional (P3MPI) menyelenggarakan...
Perkuat Inovasi dan Hilirisasi Riset, UMA Gelar Penandatanganan Kontrak Penelitian dan PkM 2026
Medan – Universitas Medan Area (UMA) kembali menegaskan komitmennya dalam memperkuat ekosistem riset dan pengabdian kepada masyarakat melalui kegiatan Penandatanganan...
KAMPUS I
Jalan Kolam Nomor 1 Medan Estate / Jalan Gedung PBSI, Medan 20223
(061) 7360168 CALL CENTER : 0811-6013-888
[email protected]
KAMPUS II
Jalan Sei Serayu No. 70 A / Jalan Setia Budi No. 79 B, Medan 20112
(061) 42402994
[email protected]

Statistik Pengunjung

  • 0
  • 35
  • 31
  • 24,810
  • 26,471
@Copyright 2026 BPDI | Universitas Medan Area

This will close in 10 seconds