Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New feature to filter datasets by column and its corresponding values #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,15 @@ sd.compile(
full_validation=True, # Optional: to save time, leave the default False value. If True, analyze consistency on modalities between columns.
date_compile_auc="01/01/2022", # Optional: useful when computing the drift for a time that is not now
datadrift_file="datadrift_auc.csv", # Optional: name of the csv file that contains the performance history of data drift
filter_column="name", # Optional: Name of the column you wish to filter
filter_values=[
"France",
"Ottomans",
"Austria",
"Poland",
"Brandenburg",
"Bohemia",
], # Optional: Names of the values from the column you chose above that you wish to filter.
)
```

Expand Down
6 changes: 6 additions & 0 deletions eurybia/core/smartdrift.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,8 @@ def __init__(
def compile(
self,
full_validation=False,
filter_column=None,
filter_values=None,
ignore_cols: list = list(),
sampling=True,
sample_size=100000,
Expand Down Expand Up @@ -236,6 +238,10 @@ def compile(
>>> SD.compile()

"""
print("FILTERING")
if filter_column and filter_values:
self.df_current = self.df_current[self.df_current[filter_column].isin(filter_values)]
self.df_baseline = self.df_baseline[self.df_baseline[filter_column].isin(filter_values)]
if datadrift_file is not None:
self.datadrift_file = datadrift_file
if hyperparameter is not None:
Expand Down