SC2Spa.tl.CrossValidation

SC2Spa.tl.CrossValidation(X: ~numpy.array, Y: ~numpy.array, train_indices, test_indices, l1_reg=1e-05, l2_reg=0, dropout=0.05, lrr_patience=20, ES_patience=50, min_lr=1e-09, NormMethod='BN', epoch=20, batch_size=4096, loss=<function rmse>, loss_name='rmse', nodes=[4096, 1024, 256, 64, 16, 4], seed=None)

Perform Cross-validation using fully connected neural network

Parameters

X

a numpy array with the shape of (cell, gene)

Y
a numpy array with the shape of (cell, dimension), where dimension is

the dimension of spatial information

train_indices

a list contains mutiple lists of the index of cells for training

test_indices
a list contains mutiple lists of the index of cells for test. The train_indices

and test_indices are paired based on the order of indices list.

l1_reg

l1 regularization factor

nodes

a list that contains the numbers of the nodes of hidden layers

lrr_patience

The patience for learning rate reduction

ES_patience

The patience for early stopping

Returns

histories

training history

train_preds

predicted locations of cells for training, which corresponds to train_indices.

test_preds

predicted locations of cells for test, which corresponds to test_indices