Lines Matching refs:model
70 self.model.load(fn)
72 self.model.save(fn)
77 self.model = cv2.ml.KNearest_create()
80 self.model = cv2.ml.KNearest_create()
81 self.model.train(samples, cv2.ml.ROW_SAMPLE, responses)
84 retval, results, neigh_resp, dists = self.model.findNearest(samples, self.k)
89 self.model = cv2.ml.SVM_create()
90 self.model.setGamma(gamma)
91 self.model.setC(C)
92 self.model.setKernel(cv2.ml.SVM_RBF)
93 self.model.setType(cv2.ml.SVM_C_SVC)
96 self.model = cv2.ml.SVM_create()
97 self.model.train(samples, cv2.ml.ROW_SAMPLE, responses)
100 return self.model.predict(samples)[1][0].ravel()
103 def evaluate_model(model, digits, samples, labels):
104 resp = model.predict(samples)
171 model = KNearest(k=4)
172 model.train(samples_train, labels_train)
173 vis = evaluate_model(model, digits_test, samples_test, labels_test)
177 model = SVM(C=2.67, gamma=5.383)
178 model.train(samples_train, labels_train)
179 vis = evaluate_model(model, digits_test, samples_test, labels_test)
182 model.save('digits_svm.dat')