Ejemplo n.º 1
0
    def _make_tuples(self, key):
        X = Stacks().load(key)
        voxel = (VoxelSize() & key).fetch1['vx', 'vy', 'vz']
        b = RankDegenerateBernoulliProcess(voxel,
                                           quadratic_channels=key['quadratic_components'],
                                           linear_channels=key['linear_components'],
                                           common_channels=key['common_components']
                                           )
        cells = (CellLocations() & key).fetch1['cells']

        b.fit(X, cells, maxiter=100)
        key.update(b.parameters)
        key['train_cross_entropy'] = b.cross_entropy(X, cells)
        key['train_auc_weighted'] = b.auc(X, cells, average='weighted')
        key['train_auc'] = b.auc(X, cells, average='macro')
        self.insert1(key)