Skip to content

To skorecard pipeline

Transform a scikit-learn Pipeline to a SkorecardPipeline.

A SkorecardPipeline is a normal scikit-learn pipeline with some extra methods and attributes.

Examples:

from skorecard.pipeline.pipeline import SkorecardPipeline, to_skorecard_pipeline
from skorecard.bucketers import DecisionTreeBucketer, OrdinalCategoricalBucketer
from skorecard import datasets

from sklearn.pipeline import make_pipeline

pipe = make_pipeline(
    DecisionTreeBucketer(variables = ["LIMIT_BAL", "BILL_AMT1"],max_n_bins=5),
    OrdinalCategoricalBucketer(variables = ["EDUCATION", "MARRIAGE"], tol =0.05)
)
sk_pipe = to_skorecard_pipeline(pipe)

df = datasets.load_uci_credit_card(as_frame=True)

features = ["LIMIT_BAL", "BILL_AMT1", "EDUCATION", "MARRIAGE"]
X = df[features]
y = df["default"].values

Parameters:

Name Type Description Default
pipeline Pipeline

scikit-learn pipeline instance.

required

Returns:

Type Description
pipeline (skorecard.pipeline.SkorecardPipeline)

modified pipeline instance.


Last update: 2021-11-24
Back to top