比如M=0.2rbf+0.7poly+0.1liner
def M_function(y_true, y_pred):
中间为所需要的代码部分
return ##
实现 classifier = svm.SVC( kernel='M')
根据搜索发现sklearn并不能直接实现该功能,调研发现MKLpy(https://github.com/IvanoLauriola/MKLpy) 可以实现多核学习,MKLpy中的EasyMKL(https://mklpy.readthedocs.io/en/latest/API/EasyMKL/ )本质上就是多核之间的和运算:
MKLpy的demo可参考博客https://blog.csdn.net/weixin_43471586/article/details/105494862 ,希望能对你有帮助。
这个楼上说的差不多