ScoreCardPoints¶
Transformer to map the the buckets from the skorecard model and maps them to the rescaled points.
Examples:
from skorecard import Skorecard
from skorecard.rescale import ScoreCardPoints
from skorecard.datasets import load_uci_credit_card
X,y = load_uci_credit_card(return_X_y=True)
model = Skorecard(variables = ["LIMIT_BAL", "BILL_AMT1","EDUCATION", "MARRIAGE"])
model.fit(X, y)
scp = ScoreCardPoints(model)
scp.transform(X)
__init__(self, skorecard_model, *, pdo=20, ref_score=100, ref_odds=1)
special
¶
Parameters:
Name | Type | Description | Default |
---|---|---|---|
skorecard_model |
the fitted Skorecard class |
required | |
pdo |
number of points necessary to double the odds |
20 |
|
ref_score |
reference score set for the reference odds |
100 |
|
ref_odds |
odds that correspond to the ref_score |
1 |
fit_transform(self, X, y=None, **fit_params)
inherited
¶
Fit to data, then transform it.
Fits transformer to X
and y
with optional parameters fit_params
and returns a transformed version of X
.
Parameters¶
X : array-like of shape (n_samples, n_features) Input samples.
y : array-like of shape (n_samples,) or (n_samples, n_outputs), default=None Target values (None for unsupervised transformations).
**fit_params : dict Additional fit parameters.
Returns¶
X_new : ndarray array of shape (n_samples, n_features_new) Transformed array.
get_params(self, deep=True)
inherited
¶
get_scorecard_points(self)
¶
Get the scorecard points.
set_params(self, **params)
inherited
¶
Set the parameters of this estimator.
The method works on simple estimators as well as on nested objects
(such as :class:~sklearn.pipeline.Pipeline
). The latter have
parameters of the form <component>__<parameter>
so that it's
possible to update each component of a nested object.
Parameters¶
**params : dict Estimator parameters.
Returns¶
self : estimator instance Estimator instance.
transform(self, X)
¶
Transform the features to the points.