himalaya.kernel_ridge.predict_and_score_weighted_kernel_ridge¶
- himalaya.kernel_ridge.predict_and_score_weighted_kernel_ridge(Ks, dual_weights, deltas, Y, score_func, split=False, n_targets_batch=None, progress_bar=False)[source]¶
Compute predictions, typically on a test set, and compute the score.
- Parameters
- Ksarray of shape (n_kernels, n_samples_test, n_samples_train)
Input kernels.
- dual_weightsarray of shape (n_samples_train, n_targets)
Dual weights of the kernel ridge model.
- deltasarray of shape (n_kernels, n_targets) or (n_kernels, )
Log kernel weights for each target.
- Yarray of shape (n_samples_test, n_targets)
Target data.
- score_funccallable
Function used to compute the score of predictions.
- splitbool
If True, the predictions is split across kernels.
- n_targets_batchint or None
Size of the batch for computing predictions. Used for memory reasons. If None, uses all n_targets at once.
- progress_barbool
If True, display a progress bar over batches and iterations.
- Returns
- scoresarray of shape (n_targets, ) or (n_kernels, n_targets) (if split)
Prediction score per target.