Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 如何找到分类器允许的最大训练集大小?_Python_Machine Learning_Scikit Learn_Decision Tree_Cross Validation - Fatal编程技术网

Python 如何找到分类器允许的最大训练集大小?

Python 如何找到分类器允许的最大训练集大小?,python,machine-learning,scikit-learn,decision-tree,cross-validation,Python,Machine Learning,Scikit Learn,Decision Tree,Cross Validation,我是Python和机器学习方面的新手。我得到的数据集包括581012条记录和54列。我正在尝试将数据拆分为80 20。80%用于培训,20%用于测试。我使用GridSearchCV进行交叉验证并找到最佳参数。由于数据太大,我执行应用程序超过一天,但无法获得结果。我认为有什么方法可以知道分类器允许的最大训练集的大小是多少?下面是我的执行代码 parameters = {'max_depth' :range(1,21)} print parameters clf = GridSearchCV(tr

我是Python和机器学习方面的新手。我得到的数据集包括581012条记录和54列。我正在尝试将数据拆分为80 20。80%用于培训,20%用于测试。我使用GridSearchCV进行交叉验证并找到最佳参数。由于数据太大,我执行应用程序超过一天,但无法获得结果。我认为有什么方法可以知道分类器允许的最大训练集的大小是多少?下面是我的执行代码

parameters = {'max_depth' :range(1,21)}
print parameters 
clf = GridSearchCV(tree.DecisionTreeClassifier(), parameters, cv=10, n_jobs=-1)
clf.fit(X,y)

tree_model = clf.best_estimator_
import pickle
s = pickle.dumps(tree_model)
print(clf.best_score_, clf.best_params_)

我认为你需要在培训前删减你的数据库。您也可以尝试使用WEKA工具。