Analysis¶
- dca.analysis.linear_decode_r2(X_train, Y_train, X_test, Y_test, decoding_window=1, offset=0)[source]¶
Train a linear model on the training set and test on the test set.
This will work with batched training data and/or batched test data.
- X_trainndarray (time, channels) or (batches, time, channels)
Feature training data for regression.
- Y_trainndarray (time, channels) or (batches, time, channels)
Target training data for regression.
- X_testndarray (time, channels) or (batches, time, channels)
Feature test data for regression.
- Y_testndarray (time, channels) or (batches, time, channels)
Target test data for regression.
- decoding_windowint
Number of time samples of X to use for predicting Y (should be odd). Centered around offset value.
- offsetint
Temporal offset for prediction (0 is same-time prediction).
- dca.analysis.random_complement(proj, size=1, random_state=None)[source]¶
Computes a random vector in the orthogonal complement to proj.
- Parameters:
proj (ndarray (full dim, low dim)) – Projection matrix.
random_state (NumPy random state (optional)) – Random state for rng.
- Returns:
comp_vec – Random vector in the complement space.
- Return type:
ndarray (full dim, 1)