Editing
AI in Finance
(section)
Jump to navigation
Jump to search
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
== <span style="color: #FFFFFF;">Applying</span> == '''Credit risk model with SHAP explanations for regulatory compliance:''' <syntaxhighlight lang="python"> import lightgbm as lgb import shap import pandas as pd from sklearn.model_selection import train_test_split from sklearn.metrics import roc_auc_score # Features: income, debt_ratio, payment_history, account_age, etc. df = pd.read_csv("credit_data.csv") X = df.drop("default", axis=1) y = df["default"] X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, stratify=y) model = lgb.LGBMClassifier( n_estimators=500, max_depth=6, learning_rate=0.05, scale_pos_weight=(y==0).sum()/(y==1).sum(), # Handle class imbalance class_weight='balanced' ) model.fit(X_train, y_train, eval_set=[(X_test, y_test)], callbacks=[lgb.early_stopping(50)]) print(f"AUC: {roc_auc_score(y_test, model.predict_proba(X_test)[:,1]):.4f}") # SHAP for regulatory explainability explainer = shap.TreeExplainer(model) shap_values = explainer.shap_values(X_test)[1] # Class 1 (default) # Per-applicant explanation for adverse action notice def get_adverse_reasons(applicant_idx, top_n=3): vals = shap_values[applicant_idx] negative_factors = sorted( [(X_test.columns[i], vals[i]) for i in range(len(vals)) if vals[i] > 0], key=lambda x: -x[1] ) return negative_factors[:top_n] </syntaxhighlight> ; AI applications in finance by domain : '''Fraud detection''' β Gradient boosting (LightGBM/XGBoost), GNN for transaction networks : '''Credit scoring''' β Logistic regression + SHAP (regulatory), LightGBM for performance : '''Algorithmic trading''' β LSTM, transformers for price prediction; RL for execution : '''Portfolio optimization''' β Mean-variance + ML factor models, deep RL : '''Document processing''' β LLMs for earnings call analysis, contract review, regulatory filings : '''Customer service''' β LLM-powered chatbots for banking queries, complaint triage </div> <div style="background-color: #8B4500; color: #FFFFFF; padding: 20px; border-radius: 8px; margin-bottom: 15px;">
Summary:
Please note that all contributions to BloomWiki may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
BloomWiki:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)
Navigation menu
Personal tools
Not logged in
Talk
Contributions
Create account
Log in
Namespaces
Page
Discussion
English
Views
Read
Edit
View history
More
Search
Navigation
Main page
Recent changes
Random page
Help about MediaWiki
Tools
What links here
Related changes
Special pages
Page information