我遇到了这个失败:
logsumexp中的文件“ C:\ Users \ ophirbh \ AppData \ Roaming \ Python \ Python38 \ site-packages \ scipy \ special_logsumexp.py”,第112行 tmp = np.exp(a-a_max) MemoryError:无法分配形状为(950028,45)和数据类型为float64的数组
该代码:
from sklearn import datasets
from sklearn.linear_model import LogisticRegression
from sklearn.model_selection import cross_val_score
X, y = datasets.load_svmlight_file('converted_features')
clf = LogisticRegression(random_state = 0, solver = 'lbfgs', multi_class =
'multinomial',max_iter=2).fit(X,y)
print(cross_val_score(clf, X, y, scoring='recall_macro', cv = 5))
有什么办法解决吗?