Skip to content
Snippets Groups Projects
Commit 95ce990d authored by Peter Lünenschloß's avatar Peter Lünenschloß
Browse files

Merge branch 'develop' into driftModelKW

parents 4f113c72 ac7a697e
No related branches found
No related tags found
8 merge requests!685Release 2.4,!684Release 2.4,!567Release 2.2.1,!566Release 2.2,!501Release 2.1,!372fix doctest snippets,!369Current documentation,!349made driftmodel Key Word String or Callable
......@@ -103,7 +103,9 @@ class FunctionWrapper:
self.args = args
self.kwargs = self._checkKwargs(kwargs)
self.targets = toSequence(kwargs.get("target", None) or [])
self.targets = (
toSequence(kwargs["target"]) if kwargs.get("target", None) else self.fields
)
self.mask_thresh = self._getMaskingThresh()
if self.data_masking:
......@@ -145,7 +147,7 @@ class FunctionWrapper:
kwargs = self.kwargs.copy()
kwargs["to_mask"] = self.mask_thresh
# always pass a list to multivariat functions and
# always pass a list to multivariate functions and
# unpack single element lists for univariate functions
if self._multivariate:
field = self.fields
......@@ -175,7 +177,7 @@ class FunctionWrapper:
return self.data.columns
# datamask == "field"
return pd.Index(self.targets or self.fields)
return pd.Index(self.fields)
def _getMaskingThresh(self) -> float:
"""
......@@ -234,12 +236,12 @@ class FunctionWrapper:
meta = self._createMeta()
new_columns = flags.columns.difference(self.flags.columns)
# Note: do not call _getMaskingColumns because it takes columns from data,
# instead of from the new flags
# NOTE: do not call _getMaskingColumns because it takes columns
# from data, instead of from the new flags
if self.datamask in (None, "all"):
columns = flags.columns
else: # datamask == field
columns = pd.Index(self.targets or self.fields)
columns = pd.Index(self.targets)
for col in columns.union(new_columns):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment