Skip to content

Commit

Permalink
simplify argument name
Browse files Browse the repository at this point in the history
  • Loading branch information
ngreenwald committed Sep 4, 2020
1 parent 70f1a8e commit e98d131
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions caliban_toolbox/dataset_builder.py
Expand Up @@ -564,7 +564,7 @@ def _validate_output_shape(self, output_shape):
'or length 3, got {}'.format(output_shape))

def build_dataset(self, tissues='all', platforms='all', output_shape=(512, 512), resize=False,
data_split=(0.8, 0.1, 0.1), seed=0, balance_dataset=False, **kwargs):
data_split=(0.8, 0.1, 0.1), seed=0, balance=False, **kwargs):
"""Construct a dataset for model training and evaluation
Args:
Expand All @@ -582,7 +582,7 @@ def build_dataset(self, tissues='all', platforms='all', output_shape=(512, 512),
- by_image. Resizes by median cell size within each image
data_split: tuple specifying the fraction of the dataset for train/val/test
seed: seed for reproducible splitting of dataset
balance_dataset: if true, randomly duplicate less-represented tissue types
balance: if true, randomly duplicate less-represented tissue types
in train and val splits so that there are the same number of images of each type
**kwargs: other arguments to be passed to helper functions
Expand Down Expand Up @@ -642,7 +642,7 @@ def build_dataset(self, tissues='all', platforms='all', output_shape=(512, 512),
min_objects=min_objects)

# don't balance test split
if balance_dataset and idx != 2:
if balance and idx != 2:
current_dict = self._balance_dict(current_dict, seed=seed, category='tissue_list')

dicts[idx] = current_dict
Expand Down
2 changes: 1 addition & 1 deletion caliban_toolbox/dataset_builder_test.py
Expand Up @@ -708,7 +708,7 @@ def test_build_dataset(tmp_path):
# full runthrough with default options changed
_ = db.build_dataset(tissues='all', platforms=platforms, output_shape=(10, 10),
relabel=True, resize='by_image', small_object_threshold=5,
balance_dataset=True)
balance=True)


def test_summarize_dataset(tmp_path):
Expand Down

0 comments on commit e98d131

Please sign in to comment.