def btnNaiveBayesClicked(self,priors,FormSetNaiveBayesParam): if priors.upper() == "NONE": priors=None self.algorithm=GaussianNB(priors=priors) AlgorithmOperation.ApplyAlgorithm(self.algorithm) self.messageBox(FormSetNaiveBayesParam)
def btnSVCClicked(self, kernel, gamma, tol, verbose, random_state, FormSetParamSVC): if random_state.upper() == "NONE": random_state = None self.algorithm = SVC(kernel=kernel, gamma=gamma, tol=float(tol), verbose=bool(verbose), random_state=random_state) AlgorithmOperation.ApplyAlgorithm(self.algorithm) self.messageBox(FormSetParamSVC)
def btnKNNClicked(self, k, weights, leaf_size, p, metric, n_jobs, FormSetKNNParam): self.algorithm = KNeighborsClassifier(int(k), weights, leaf_size=int(leaf_size), p=int(p), metric=metric, metric_params=None, n_jobs=int(n_jobs)) AlgorithmOperation.ApplyAlgorithm(self.algorithm) self.messageBox(FormSetKNNParam)
def btnRandomForestClicked(self,n_estimators,criterion,max_depth,min_samples_split,min_samples_leaf, min_weight_fraction_leaf,min_impurity_decrease,n_jobs,random_state,FormSetRandomForestParam): if random_state.upper()=="NONE": random_state=None if max_depth.upper()=="NONE": max_depth=None self.algorithm= RandomForestClassifier(int(n_estimators),criterion,max_depth, int(min_samples_split),int(min_samples_leaf), float(min_weight_fraction_leaf), min_impurity_decrease=float(min_impurity_decrease), n_jobs=int(n_jobs),random_state=random_state) AlgorithmOperation.ApplyAlgorithm(self.algorithm) self.messageBox(FormSetRandomForestParam)
def btnSetAndRunClicked(self,criterion,max_depth,min_samples_split, min_samples_leaf,min_weight_fraction_leaf, random_state,max_leaf_nodes,FormSetParamDecisionTree): if max_leaf_nodes.upper() == "NONE": max_leaf_nodes = None if max_depth.upper() == "NONE": max_depth=None if random_state.upper() == "NONE": random_state=None self.algorithm = tree.DecisionTreeClassifier(criterion, max_depth=max_depth , min_samples_split=int(min_samples_split) , min_samples_leaf=int(min_samples_leaf) , min_weight_fraction_leaf=float(min_weight_fraction_leaf) , random_state=random_state, max_leaf_nodes=max_leaf_nodes) AlgorithmOperation.ApplyAlgorithm(self.algorithm) self.messageBox(FormSetParamDecisionTree)