def setUpClass(): TestClassificationMetrics.test_knn_classifier = knn.KNN( "classifier", 4) TestClassificationMetrics.test_knn_classifier.load_csv( 'datasets/Iris.csv', 'Species') TestClassificationMetrics.test_knn_classifier.train_test_split(0.2) print('from setUpClass')
def setUpClass(self): # Create example observations for auto_mpg dataset self.reg_obs1 = [4, 97, 46, 1835, 20.5] self.reg_obs2 = [8, 318, 210, 4382, 13.5] self.reg_obs3 = [-4, -97, -46, -1835, -20.5] # Create example observations for iris dataset self.clf_obs1 = [5.2, 3.4, 1.4, 0.2] self.clf_obs2 = [7.2, 3, 5.8, 1.6] self.clf_obs3 = [-5.2, -3.4, -1.4, -0.2] # Create KNN regressor self.knn_regressor = knn.KNN('regressor') # Create KNN classifier self.knn_classifier = knn.KNN('classifier', 4) # Compare our model's predictions with sklearn's KNN implementation # Create sklearn regressor self.sklearn_regressor = KNeighborsRegressor(n_neighbors=3) # Create sklearn classifier self.sklearn_classifier = KNeighborsClassifier(n_neighbors=4)
def setUpClass(): TestRegressionMetrics.test_knn_regressor = knn.KNN("regressor",7) TestRegressionMetrics.test_knn_regressor.load_csv('datasets/auto_mpg.csv','mpg') TestRegressionMetrics.test_knn_regressor.train_test_split(0.25) print('from setUpClass')
def setUpClass(): TestVariables.test_knn_classifier = knn.KNN("classifier", 4)
def setUpClass(): Testload_csv.test_knn_regressor = knn.KNN("regressor", 2)
def setUpClass(): TestDataCollection_classifier.test_knn_classifier = knn.KNN( "classifier", 3)
def setUpClass(): TestDataCollection_regressor.test_knn_regressor = knn.KNN( "regressor", 2)