Skip to content

Commit

Permalink
Fixup the abundance filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
gmrukwa committed Dec 10, 2019
1 parent 7a9405c commit aec664c
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ on:
env:
MAJOR: ${{ 2 }}
MINOR: ${{ 3 }}
FIXUP: ${{ 1 }}
FIXUP: ${{ 2 }}
PACKAGE_INIT_FILE: ${{ 'divik/__init__.py' }}
DOCKER_REPO: ${{ 'gmrukwa/divik' }}
IS_ALPHA: ${{ github.event_name == 'pull_request' }}
Expand Down
2 changes: 1 addition & 1 deletion divik/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = '2.3.1'
__version__ = '2.3.2'

from ._seeding import seeded
from ._sklearn import DiviK
Expand Down
13 changes: 8 additions & 5 deletions divik/_feature_selection/_specialized.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
from sklearn.base import BaseEstimator
from sklearn.feature_selection.base import SelectorMixin
from ._gmm_selector import GMMSelector
from ._outlier import OutlierOrTopSelector
from ._outlier import OutlierSelector, OutlierOrTopSelector
from ._percentage_selector import PercentageSelector


class HighAbundanceAndVarianceSelector(BaseEstimator, SelectorMixin):
Expand Down Expand Up @@ -146,11 +147,13 @@ def fit(self, X, y=None):
-------
self
"""
self.abundance_selector_ = OutlierOrTopSelector(
self.abundance_selector_ = OutlierSelector(
stat='mean', use_log=self.use_log,
keep_outliers=self.keep_outliers,
min_features_rate=self.min_features_rate,
p=1.0 - self.p).fit(X)
keep_outliers=False).fit(X)
if self.abundance_selector_.selected_.mean() < self.min_features_rate:
self.abundance_selector_ = PercentageSelector(
stat='mean', use_log=self.use_log, keep_top=True,
p=1.0 - self.p).fit(X)
filtered = self.abundance_selector_.transform(X)
self.selected_ = self.abundance_selector_.selected_.copy()

Expand Down

0 comments on commit aec664c

Please sign in to comment.