04f4305931bedd43ca76190b25de120239d2dfe6,deepchem/splits/tests/test_splitter.py,TestSplitter,test_singletask_stratified_column_indices,#TestSplitter#,314
Before Change
y[:n_positives] = 1
w = np.ones((n_samples, n_tasks))
stratified_splitter = dc.splits.RandomStratifiedSplitter()
column_indices = stratified_splitter.get_task_split_indices(
y, w, frac_split=.5)
split_index = column_indices[0]
// The split index should partition dataset in half.
assert np.count_nonzero(y[:split_index]) == 10
def test_singletask_stratified_column_indices_mask(self):
After Change
// The split index should partition dataset in half.
assert len(train) == 50
assert len(valid) == 0
assert len(test) == 50
assert np.count_nonzero(y[train]) == 10
assert np.count_nonzero(y[test]) == 10
def test_singletask_stratified_column_indices_mask(self):
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances
Project Name: deepchem/deepchem
Commit Name: 04f4305931bedd43ca76190b25de120239d2dfe6
Time: 2020-09-28
Author: peastman@stanford.edu
File Name: deepchem/splits/tests/test_splitter.py
Class Name: TestSplitter
Method Name: test_singletask_stratified_column_indices
Project Name: deepchem/deepchem
Commit Name: 04f4305931bedd43ca76190b25de120239d2dfe6
Time: 2020-09-28
Author: peastman@stanford.edu
File Name: deepchem/splits/tests/test_splitter.py
Class Name: TestSplitter
Method Name: test_multitask_stratified_column_indices_masked
Project Name: deepchem/deepchem
Commit Name: 04f4305931bedd43ca76190b25de120239d2dfe6
Time: 2020-09-28
Author: peastman@stanford.edu
File Name: deepchem/splits/tests/test_splitter.py
Class Name: TestSplitter
Method Name: test_multitask_stratified_column_indices