[英]Python : GridSearchCV is taking too long to execute
I am running GridSearchCV on small dataset, which size is (13380,37) and code is as below:我在小型数据集上运行 GridSearchCV,其大小为 (13380,37),代码如下:
from sklearn.model_selection import RandomizedSearchCV,GridSearchCV
parameters = {kernel:('linear','rbf','poly'),'C':[1.5,2,3,4,5,6,7,8,9,10],'gamma':[1e-7,1e-6,1e-4,1e-3,1e-2]}
svc = SVC()
clf = GridSearchCV(svc,parameters,n_jobs=38)
search = clf.fit(X_train,y_train)
search.best_params_
It is running for more than a day.它运行了一天多。 But with the same parameters if i run it on iris dataset,it is giving the result in 1 min.
但是如果我在 iris 数据集上运行相同的参数,它会在 1 分钟内给出结果。 The data is standardized and using multiprocessing too.
数据是标准化的并且也使用多处理。 Am i missing anything here.
我在这里有什么遗漏吗?
I think the problem is with the njobs you indicated.我认为问题出在您指出的 njobs 上。 change it from 38 to -1 and that should do the job fast enough.
将其从 38 更改为 -1,这应该足够快地完成这项工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.