himalaya icon indicating copy to clipboard operation
himalaya copied to clipboard

MultipleKernelRidgeCV deltas shared over all targets?

Open cnnmat opened this issue 2 years ago • 3 comments

Is it somehow possible to have the deltas of the model optimized for best fitting all targets when using Multiple-kernel ridge with scikit-learn API? Meaning that the deltas_ output (or another output) of MultipleKernelRidgeCV would be: array of shape (n_kernels, 1) Best log kernel weights for all targets. instead of array of shape (n_kernels, n_targets) Best log kernel weights for each target.

I still have several targets but would be interested in the "shared over all targets" result.

I tried using the parameter local_alpha = False in the solver_params of the MultipleKernelRidgeCV but I don't find any optimized alpha or delta in the output model (and there is no more best_alphas_ or deltas_ either).

Thank you in advance for your help :)

cnnmat avatar Jun 02 '22 14:06 cnnmat

I agree optimizing a single delta for all targets would be useful. ~It is currently not implemented, but I will add it to the todo list.~

TomDLT avatar Jun 03 '22 03:06 TomDLT

Great, thank you very much! :)

cnnmat avatar Jun 03 '22 07:06 cnnmat

Actually I just checked, and using local_alpha=False does select the same alpha/delta for all targets, as found in model.best_alphas_ and model.deltas_. My previous answer assumed that it only shared alphas and not deltas, but it does share both. (The option is only available with solver="random_search" though.)

there is no more best_alphas_ or deltas_ either

Are you sure you fitted the model the second time?

TomDLT avatar Jun 15 '22 01:06 TomDLT