lr-tuning

Jointly optimize WoE binning and logistic regression regularization with Optuna TPE.

580|66|Updated Apr 21, 2025
One-click install
npx skills add https://github.com/aliyun/qwen-dianjin --skill lr-tuning
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lr-tuning
Source: https://github.com/aliyun/qwen-dianjin/tree/main/DianJin-SKILLS/financial-engineering-expert/lr-tuning
Command: npx skills add https://github.com/aliyun/qwen-dianjin --skill lr-tuning

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires optuna, sklearn, joblib, pandas, numpy, xgboost, optbinning, and includes scripts (resource) components.

What problem does it solve?

This Skill helps you improve LR scorecard performance by diagnosing overfitting or underfitting and then tuning both WoE binning settings and LR regularization to achieve better out-of-time (OOT) stability.

Core Features & Use Cases

  • WoE + LR Joint Tuning: Uses Bayesian optimization (Optuna TPE) to jointly search WoE binning parameters (max_n_bins, iv_threshold) and LR parameters (C, regularization).
  • Diagnosis-Driven Constraints: Adjusts the search space based on model status (overfit / underfit / well-fit) using Train vs Val gaps while keeping OOT strictly for reporting.
  • Interactive and AUTO Modes: Supports single-round interactive tuning (pause for feedback) and multi-round AUTO tuning until convergence.

Quick Start

Run lr-tuning after you have a baseline LR scorecard model trained with lr-modeling, and ask the agent to automatically tune it on your dataset by calling the LR tuning skill with your data_path and target.

Frequently Asked Questions about lr-tuning

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I improve LR scorecard out-of-time predictive stability?

To improve LR scorecard out-of-time (OOT) stability, you can use Optuna TPE Bayesian optimization to jointly tune WoE binning parameters and logistic regression regularization, diagnosing overfitting or underfitting via Train vs Val gaps.

What is the best way to tune WoE binning and logistic regression hyperparameters?

The best way to tune WoE binning and logistic regression hyperparameters is using Optuna TPE Bayesian optimization to search over max_n_bins, iv_threshold, C, and regularization to maximize AUC and KS metrics.

Do I need a baseline model before tuning logistic regression scorecards?

Yes, you need a baseline LR scorecard model trained with lr-modeling before tuning, as the tuning skill requires an existing baseline to diagnose and optimize for better out-of-time performance.

How does diagnosis-driven constrained search work for credit risk modeling?

Diagnosis-driven constrained search adjusts the hyperparameter search space based on model status by comparing Train vs Val gaps, keeping OOT data strictly for reporting to ensure reliable credit risk modeling evaluation.

Can I automate hyperparameter tuning for my credit risk scorecard?

Yes, you can automate hyperparameter tuning by using the AUTO mode, which performs multi-round Optuna TPE optimization until convergence, or use the interactive mode for single-round tuning with feedback.

Why does my logistic regression scorecard have poor OOT performance?

Poor OOT performance usually indicates logistic regression overfitting or underfitting, which can be diagnosed by analyzing Train vs Val gaps and corrected by jointly tuning WoE binning and regularization parameters.