python pls_python – sklearn的PLSRegression:“ValueError:数组不能包含infs或NaNs”
importnumpyasnpimportsklearn.cross_decompositionpls2=sklearn.cross_decomposition.PLSRegression()xx=np.random.random((5,5))yy=np.zeros((5,5))yy[0,:]=[0,1,0,0,0]yy[1,:]=[0,0,0,1,0]yy[2,:]=[0,0,0,0,1]#yy