Skip to content

Commit

Permalink
Merge pull request #19 from emergentmethods/fix/outlier-checkl
Browse files Browse the repository at this point in the history
fix: ensure outlier check isnt trying to convert the return array to df
  • Loading branch information
robcaulk authored Jun 25, 2023
2 parents 0b3cfb4 + 9d1d18f commit 80e29e3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions datasieve/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ def transform(self, X, y=None, sample_weight=None, outlier_check=False) -> Tuple
**self.fitparams[name]
)

X, y, sample_weight = self._convert_back_to_df(X, y, sample_weight, feature_list)
X, y, sample_weight = self._convert_back_to_df(X, y, sample_weight, feature_list, outlier_check)

return X, y, sample_weight

Expand Down Expand Up @@ -195,15 +195,15 @@ def _validate_arguments(self, X, y, sample_weight, fit=False, outlier_check=Fals

return X, y, sample_weight

def _convert_back_to_df(self, X, y, sample_weight, feature_list):
def _convert_back_to_df(self, X, y, sample_weight, feature_list, outlier_check=False):
if not self.pandas_types:
return X, y, sample_weight

assert X.shape[1] == len(feature_list)

X = pd.DataFrame(X, columns=feature_list)

if y is not None:
if y is not None and not outlier_check:
y = pd.DataFrame(y, columns=self.label_list)

return X, y, sample_weight
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "datasieve"
version = "0.1.5"
version = "0.1.6"
description = "This package implements a flexible data pipeline to help organize row removal (e.g. outlier removal) and feature modification (e.g. PCA)"
authors = ['Robert Caulk']
readme = "README.md"
Expand Down

0 comments on commit 80e29e3

Please sign in to comment.