python grid search code example
Example 1: python grid
example1 = Label(root, text="Top left column")
example1.grid(row=0, column=0)
example2 = Label(root, text="Middle right colum") .grid(row=1, column=1)
example3 = Label(root, text="Bottom Row")
example3.grid(row=2, columnspan=2)
Example 2: Exhaustive search over specified parameter values for an estimator
from sklearn import svm, datasets
from sklearn.model_selection import GridSearchCV
iris = datasets.load_iris()
parameters = {'kernel':('linear', 'rbf'), 'C':[1, 10]}
svc = svm.SVC()
clf = GridSearchCV(svc, parameters)
clf.fit(iris.data, iris.target)
sorted(clf.cv_results_.keys())
Example 3: how to make a grid in python
grids = [[0] * gridSize for _ in range(gridSize)]