Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[python] model_diagnostics and predict_surrogate (#290)
* update readme * add ResidualDiagnostics * add predict_surrogate * upgrade the predict_fn selection * add plot to ResidualDiagnostics * add print method * add tests to model_diagnostics * optimize tests * add tests to predict_surrogate * fix test * fix ci
- Loading branch information
Showing
25 changed files
with
555 additions
and
40 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
from ._aggregated_profiles.object import AggregatedProfiles | ||
from ._model_performance.object import ModelPerformance | ||
from ._variable_importance.object import VariableImportance | ||
from ._residual_diagnostics import ResidualDiagnostics | ||
|
||
__all__ = [ | ||
"ModelPerformance", | ||
"VariableImportance", | ||
"AggregatedProfiles" | ||
"AggregatedProfiles", | ||
"ResidualDiagnostics" | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
python/dalex/dalex/dataset_level/_residual_diagnostics/__init__.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
from .object import ResidualDiagnostics | ||
|
||
__all__ = [ | ||
"ResidualDiagnostics" | ||
] |
17 changes: 17 additions & 0 deletions
17
python/dalex/dalex/dataset_level/_residual_diagnostics/checks.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import numpy as np | ||
import pandas as pd | ||
|
||
|
||
def check_variables(variables): | ||
# treating variables as list simplifies code | ||
if variables is not None and not isinstance(variables, (str, list, np.ndarray, pd.Series)): | ||
raise TypeError("variables must be None or str or list or np.ndarray or pd.Series") | ||
|
||
if variables is None: | ||
variables_ = None | ||
elif isinstance(variables, str): | ||
variables_ = [variables] | ||
else: | ||
variables_ = list(variables) | ||
|
||
return variables_ |
Oops, something went wrong.