Skip to content

Commit

Permalink
Merge pull request #266 from theislab/development
Browse files Browse the repository at this point in the history
New version release
  • Loading branch information
LouisK92 committed May 10, 2023
2 parents 266bab0 + 32aa90e commit 28b974a
Show file tree
Hide file tree
Showing 8 changed files with 21 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .cookietemple.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
4 changes: 2 additions & 2 deletions .github/release-drafter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name-template: "0.1.2 🌈" # <<COOKIETEMPLE_FORCE_BUMP>>
tag-template: 0.1.2 # <<COOKIETEMPLE_FORCE_BUMP>>
name-template: "0.1.3 🌈" # <<COOKIETEMPLE_FORCE_BUMP>>
tag-template: 0.1.3 # <<COOKIETEMPLE_FORCE_BUMP>>
categories:
- title: "🚀 Features"
labels:
Expand Down
2 changes: 1 addition & 1 deletion cookietemple.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.1.2
current_version = 0.1.3

[bumpversion_files_whitelisted]
init_file = spapros/__init__.py
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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 = "spapros"
version = "0.1.2" # <<COOKIETEMPLE_FORCE_BUMP>>
version = "0.1.3" # <<COOKIETEMPLE_FORCE_BUMP>>
description = "Probe set selection for targeted spatial transcriptomics."
authors = ["Lukas Heumos <lukas.heumos@posteo.net>", "Louis Kümmerle <louis.kuemmerle@helmholtz-muenchen.de>"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion spapros/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]

Expand Down
11 changes: 11 additions & 0 deletions spapros/evaluation/evaluation.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import os
import gc
import pickle
import warnings
from enum import Enum
Expand Down Expand Up @@ -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")
Expand Down Expand Up @@ -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:
Expand Down
5 changes: 2 additions & 3 deletions spapros/evaluation/metrics.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit 28b974a

Please sign in to comment.