class FeaturePreprocessorTest(unittest.TestCase): def setUp(self): self.path = 'D:/dane/' self.feature_preprocessor = FeaturePreprocessor(self.path) self.feature_preprocessor.apply() def test_number_of_organs(self): self.assertEqual( len(self.feature_preprocessor.list_with_features_object), 6) def test_get_features(self): dic = self.feature_preprocessor.get_feature() def test_get_classificator(self): dic = self.feature_preprocessor.get_data_for_classificator()
class FeaturePreprocessorTest(unittest.TestCase): def setUp(self): self.path = 'D:/dane/' self.feature_preprocessor = FeaturePreprocessor(self.path) self.feature_preprocessor.apply() def test_number_of_organs(self): self.assertEqual(len(self.feature_preprocessor.list_with_features_object), 6) def test_get_features(self): dic = self.feature_preprocessor.get_feature() def test_get_classificator(self): dic = self.feature_preprocessor.get_data_for_classificator()
__author__ = 'Agnieszka' __author__ = 'Agnieszka' from DataClassification.FeaturePreprocessor import FeaturePreprocessor __author__ = 'Agnieszka' import gc __author__ = 'Agnieszka' import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets, cross_validation path = 'D:/dane/' feature_preprocessor = FeaturePreprocessor(path) feature_preprocessor.apply() data, label = feature_preprocessor.get_data_for_classificator() # import some data to play with X = data[:, :-1] # avoid this ugly slicing by using a two-dim dataset y = data[:, -1] h = .02 # step size in the mesh # we create an instance of SVM and fit out data. We do not scale our # data since we want to plot the support vectors C = 1.0 # SVM regularization parameter #svc = svm.SVC(kernel='linear', C=C)
def setUp(self): self.path = 'D:/dane/' self.feature_preprocessor = FeaturePreprocessor(self.path) self.feature_preprocessor.apply()
from DataClassification.FeaturePreprocessor import FeaturePreprocessor __author__ = 'Agnieszka' import gc __author__ = 'Agnieszka' import numpy as np import matplotlib.pyplot as plt from sklearn import svm, datasets, cross_validation path = 'D:/dane/' feature_preprocessor = FeaturePreprocessor(path) feature_preprocessor.apply() data,label=feature_preprocessor.get_data_for_classificator() # import some data to play with X = data[:,:-1] # avoid this ugly slicing by using a two-dim dataset y = data[:,-1] X = X[y != 6] y = y[y != 6] h = .02 # step size in the mesh # we create an instance of SVM and fit out data. We do not scale our # data since we want to plot the support vectors C = 1.0 # SVM regularization parameter svc = svm.SVC(kernel='linear', C=C)