pyntbci.stimulus.optimize_layout_incremental
- pyntbci.stimulus.optimize_layout_incremental(X: ndarray[Any, dtype[_ScalarType_co]], neighbours: ndarray[Any, dtype[_ScalarType_co]], n_initializations: int = 100, n_iterations: int = 100) ndarray[Any, dtype[_ScalarType_co]] [source]
Optimize the allocation of codes to a layout by considering the correlation between neighboring codes. This method was developed and evaluated as part of [17]_.
- Parameters:
X (NDArray) – Data matrix of shape (n_codes, n_samples).
neighbours (NDArray) – A matrix of neighbouring pairs of shape (n_neighbours, 2).
n_initializations (int (default: 50)) – The number of random initial layouts to test.
n_iterations (int (default: 50)) – The maximum number of iterations to improve a specific initial layout.
- Returns:
layout – The vector containing the mapping of codes to positions of shape (n_codes).
- Return type:
NDArray
References