Skip to content

Commit

Permalink
v2024.7.8
Browse files Browse the repository at this point in the history
Fixed error with MANIFEST.in where requirements weren't copied over. Also added memory_profiler to bayesian fit method.
  • Loading branch information
jolespin committed Jul 8, 2024
1 parent b947715 commit eb6fdaa
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ graft clairvoyance
include setup.py
include LICENSE.txt
include README.md
include requirements.txt
global-exclude *.py[cod]
global-exclude Icon*
global-exclude .DS_Store
Expand Down
2 changes: 1 addition & 1 deletion clairvoyance/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
__version__ = "2024.7.6"
__version__ = "2024.7.8"

from . import utils
from . import visuals
Expand Down
Empty file added clairvoyance/__pycache__/Icon
Empty file.
6 changes: 5 additions & 1 deletion clairvoyance/bayesian.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
ClairvoyanceRecursiveFeatureElimination,
)

# Memory profiling
from memory_profiler import profile

_bayesianclairvoyancebase_docstring = """
# Modeling parameters:
# ====================
Expand Down Expand Up @@ -455,7 +458,6 @@ def _feature_selection(self, estimator, X, y, X_testing, y_testing, study_name):
# Show the feature weights be scaled? Before or after
return (selected_features, model_fs.initial_feature_importances_, model_fs.feature_selected_importances_, model_fs.performance_drifts_, feature_selected_training_cv, feature_selected_testing_score)


def _fit(self, X, y, cv, X_testing=None, y_testing=None, optimize_with_training_and_testing="auto", **study_kws): # How to use the test set here?
if self.copy_X:
self.X_ = X.copy()
Expand Down Expand Up @@ -624,6 +626,7 @@ def _get_results(self):
df.index.name = "study_name"
return df

@profile
def fit(self, X, y, cv=3, X_testing=None, y_testing=None, optimize_with_training_and_testing="auto", **study_kws):
self._fit(
X=X,
Expand All @@ -637,6 +640,7 @@ def fit(self, X, y, cv=3, X_testing=None, y_testing=None, optimize_with_training
self.results_ = self._get_results()
return self

@profile
def fit_transform(self, X, y, cv=3, X_testing=None, y_testing=None, optimize_with_training_and_testing="auto", **study_kws):
self._fit(
X=X,
Expand Down
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ xarray>=0.10.3
seaborn>=0.10.1
optuna>=3.6.1
feature_engine>=1.8.0
memory-profiler
#shap>=0.45.1
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
description='Feature selection via recursive feature inclusion',
url='https://github.com/jolespin/clairvoyance',
author='Josh L. Espinoza',
author_email='[email protected]',
author_email='[email protected]',
license='BSD-3',
packages=["clairvoyance"],
install_requires=requirements[::-1],
Expand Down

0 comments on commit eb6fdaa

Please sign in to comment.