Memory Error at Python while converting to array
问题 My code is shown below: from sklearn.datasets import load_svmlight_files import numpy as np perm1 =np.random.permutation(25000) perm2 = np.random.permutation(25000) X_tr, y_tr, X_te, y_te = load_svmlight_files(("dir/file.feat", "dir/file.feat")) #randomly shuffle data X_train = X_tr[perm1,:].toarray()[:,0:2000] y_train = y_tr[perm1]>5 #turn into binary problem The code works fine until here, but when I try to convert one more object to an array, my program returns a memory error. Code: X_test