diff --git a/.cookietemple.yml b/.cookietemple.yml index 2f371d50..6a175245 100644 --- a/.cookietemple.yml +++ b/.cookietemple.yml @@ -15,5 +15,5 @@ full_name: Lukas Heumos email: lukas.heumos@posteo.net project_name: spapros project_short_description: Fully automated spatial transcriptomics probe selection. -version: 0.1.2 +version: 0.1.3 license: MIT diff --git a/.github/release-drafter.yml b/.github/release-drafter.yml index 9bd97a98..0fdc078b 100644 --- a/.github/release-drafter.yml +++ b/.github/release-drafter.yml @@ -1,5 +1,5 @@ -name-template: "0.1.2 🌈" # <> -tag-template: 0.1.2 # <> +name-template: "0.1.3 🌈" # <> +tag-template: 0.1.3 # <> categories: - title: "🚀 Features" labels: diff --git a/cookietemple.cfg b/cookietemple.cfg index c80df996..0defe163 100644 --- a/cookietemple.cfg +++ b/cookietemple.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 0.1.2 +current_version = 0.1.3 [bumpversion_files_whitelisted] init_file = spapros/__init__.py diff --git a/docs/conf.py b/docs/conf.py index a6a14461..a3c67023 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -102,9 +102,9 @@ # the built documents. # # The short X.Y version. -version = "0.1.2" +version = "0.1.3" # The full version, including alpha/beta/rc tags. -release = "0.1.2" +release = "0.1.3" # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. diff --git a/pyproject.toml b/pyproject.toml index 81079d66..a7cb6bc8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "spapros" -version = "0.1.2" # <> +version = "0.1.3" # <> description = "Probe set selection for targeted spatial transcriptomics." authors = ["Lukas Heumos ", "Louis Kümmerle "] license = "MIT" diff --git a/spapros/__init__.py b/spapros/__init__.py index c9a384c8..2fa35177 100644 --- a/spapros/__init__.py +++ b/spapros/__init__.py @@ -2,7 +2,7 @@ __author__ = "Lukas Heumos" __email__ = "lukas.heumos@posteo.net" -__version__ = "0.1.2" +__version__ = "0.1.3" __all__ = ["se", "ev", "pl", "ut"] diff --git a/spapros/evaluation/evaluation.py b/spapros/evaluation/evaluation.py index d6771c37..4d89f05e 100644 --- a/spapros/evaluation/evaluation.py +++ b/spapros/evaluation/evaluation.py @@ -1,4 +1,5 @@ import os +import gc import pickle import warnings from enum import Enum @@ -1912,6 +1913,11 @@ def single_forest_classifications( ct_trees[ct].append(ct_trees_i[ct]) if progress and verbose: progress.advance(forest_task) + # garbage collection + del X_train + del y_train + del cts_train + gc.collect() # Get feature importances importances = { ct: pd.DataFrame(index=a.var.index, columns=[str(i) for i in range(n_trees)], dtype="float64") @@ -1939,6 +1945,11 @@ def single_forest_classifications( cts_test=cts_test, masks=masks_test, ) + #garbage collection + del X_test + del y_test + del cts_test + gc.collect() # Sort results if sort_by_tree_performance: diff --git a/spapros/evaluation/metrics.py b/spapros/evaluation/metrics.py index 3357234f..12dd944e 100644 --- a/spapros/evaluation/metrics.py +++ b/spapros/evaluation/metrics.py @@ -1000,18 +1000,17 @@ def xgboost_forest_classification( n_classes = len(np.unique(train_y)) clf = XGBClassifier( max_depth=max_depth, - num_class=n_classes, + num_class=n_classes if n_classes > 2 else None, n_estimators=250, objective="multi:softmax" if n_classes > 2 else "binary:logistic", early_stopping_rounds=5, - eval_metric="mlogloss", + eval_metric="mlogloss" if n_classes > 2 else "logloss", learning_rate=lr, colsample_bytree=colsample_bytree, min_child_weight=min_child_weight, gamma=gamma, booster="gbtree", # TODO: compare with 'dart',rate_drop= 0.1 random_state=seed, - use_label_encoder=False, # To get rid of deprecation warning we convert labels into ints n_jobs=n_jobs, ) clf.fit(