Skip to content

Commit

Permalink
normalization of drift
Browse files Browse the repository at this point in the history
drift measure is now between 0. and 1. (%)
  • Loading branch information
AxeldeRomblay committed Aug 2, 2017
1 parent b1bbb8e commit 682f09c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 2 additions & 3 deletions python-package/mlbox/preprocessing/drift/drift_estimator.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ def score(self):

"""Returns the global drift measure between two datasets.
0.50 = No drift. 1.00 = Maximal Drift
0. = No drift. 1. = Maximal Drift
Returns
-------
Expand All @@ -177,8 +177,7 @@ def score(self):
S.append(roc_auc_score(self.__cible.iloc[test_index],
self.__pred[test_index]))

# TODO: return the mean of mirrored AUC metrics
return max(np.mean(S), 1-np.mean(S))
return (max(np.mean(S), 1-np.mean(S))-0.5) * 2

else:
raise ValueError('Call the fit function before !')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ class DriftThreshold():
----------
threshold : float, defaut = 0.6
The drift threshold (univariate drift below are kept)
Must be between 0.5 and 1.
Must be between 0. and 1.
subsample : float, defaut = 1.
Subsampling parameter for the datasets.
Expand Down
9 changes: 5 additions & 4 deletions python-package/mlbox/preprocessing/drift_thresholder.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,10 @@ class Drift_thresholder():
Parameters
----------
threshold : float, defaut = 0.9
Threshold used to deletes variables and ids. Must be between 0.5 and 1.
The lower the more you keep non-drifting/stable variables.
threshold : float, defaut = 0.6
Drift threshold under which features are kept. Must be between 0. and 1.
The lower the more you keep non-drifting/stable variables: a feature with
a drift measure of 0. is very stable and a one with 1. is highly unstable.
inplace : bool, default = False
If True, train and test datasets are transformed. Returns self.
Expand All @@ -37,7 +38,7 @@ class Drift_thresholder():
"""

def __init__(self,
threshold=0.8,
threshold=0.6,
inplace=False,
verbose=True,
to_path="save"):
Expand Down

0 comments on commit 682f09c

Please sign in to comment.