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

Fully randomized grids; Lazy-loading model dictionary #69

Merged
merged 31 commits into from
Oct 27, 2024
Merged
Changes from 1 commit
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d1b0678
update parameter options for completely random rotation angle of ense…
chenyangkang Oct 24, 2024
8826ea1
pre-commit syntax correction
chenyangkang Oct 24, 2024
93ed961
add more pytest on the completely_random_rotation; #59
chenyangkang Oct 24, 2024
9556f6e
update badge
chenyangkang Oct 24, 2024
c26e686
add lazyloading model dictionary choices; Save ensmebles of models to…
chenyangkang Oct 25, 2024
5f878da
fix tests
chenyangkang Oct 25, 2024
ec8cc91
fix test
chenyangkang Oct 25, 2024
99f0bb4
add test for lazyloading
chenyangkang Oct 26, 2024
26f3271
fix
chenyangkang Oct 26, 2024
da34854
lazy_loading/saving dir name no longer controled by random_state para…
chenyangkang Oct 26, 2024
62cdaae
fix
chenyangkang Oct 26, 2024
cf079e6
update
chenyangkang Oct 26, 2024
55e7dfe
fix
chenyangkang Oct 26, 2024
3ebe936
change njobs to n_jobs, following sklearn way
chenyangkang Oct 26, 2024
690ac08
add test for Hurdle_for_AdaSTEM
chenyangkang Oct 26, 2024
d573274
update tests to cover more
chenyangkang Oct 26, 2024
a7740f1
fix tests
chenyangkang Oct 26, 2024
9cf0b70
fix tests; fix AdaSTEM score method
chenyangkang Oct 27, 2024
045f552
lazy loading pytests
chenyangkang Oct 27, 2024
07bd202
fix
chenyangkang Oct 27, 2024
577637d
fix n_jobs
chenyangkang Oct 27, 2024
d0c4b0e
fix
chenyangkang Oct 27, 2024
d38ff40
fix
chenyangkang Oct 27, 2024
8fdba80
fix
chenyangkang Oct 27, 2024
be81716
update tests
chenyangkang Oct 27, 2024
522d384
update doc1
chenyangkang Oct 27, 2024
7f0c050
update
chenyangkang Oct 27, 2024
853ca39
fix
chenyangkang Oct 27, 2024
4f466eb
fix
chenyangkang Oct 27, 2024
df392d1
update version
chenyangkang Oct 27, 2024
2f6dc8f
update lazyloading docs
chenyangkang Oct 27, 2024
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
Prev Previous commit
Next Next commit
fix
  • Loading branch information
chenyangkang committed Oct 26, 2024
commit 26f327103cb092ca2639994a108266c1cf95041a
6 changes: 3 additions & 3 deletions stemflow/utils/lazyloading.py
Original file line number Diff line number Diff line change
@@ -46,10 +46,10 @@ def dump_ensemble(self, ensemble_id):
Dump the model to disk and remove it from memory.
"""
if str(ensemble_id) in self.ensemble_models:
if os.path.exists(os.path.join({self.directory}, f"ensemble_{ensemble_id}_dict.pkl")):
if os.path.exists(os.path.join(self.directory, f"ensemble_{ensemble_id}_dict.pkl")):
pass
else:
joblib.dump(self.ensemble_models[str(ensemble_id)], os.path.join({self.directory}, f"ensemble_{ensemble_id}_dict.pkl"))
joblib.dump(self.ensemble_models[str(ensemble_id)], os.path.join(self.directory, f"ensemble_{ensemble_id}_dict.pkl"))
del self.ensemble_models[str(ensemble_id)]
else:
raise ValueError(f'Ensemble {str(ensemble_id)} not exist in the current dictionary')
@@ -66,4 +66,4 @@ def load_ensemble(self, ensemble_id):
Load the whole ensemble of models from disk into memory.
"""
if str(ensemble_id) not in self.ensemble_models:
self.ensemble_models[str(ensemble_id)] = joblib.load(os.path.join({self.directory}, f"ensemble_{ensemble_id}_dict.pkl"))
self.ensemble_models[str(ensemble_id)] = joblib.load(os.path.join(self.directory, f"ensemble_{ensemble_id}_dict.pkl"))
Loading