from cross_validation import CrossValidation from preprocessor import Preprocessor from dataSet import DataSet from knn_classifier import KnnClassifier from rna_classifier import RnaClassifier from hybrid_classifier import HybridClassifier from rna_module import RnaModule from knn_module import KnnModule from evaluate_module import EvaluateModule dts = DataSet() dts.setFilePath("bases/sub_bases/") #CONFIGURACAO DA REDE NEURAL rna = RnaModule() rna.setNumberNeuronsImputLayer(30) rna.setActivationFunctionImputLayer("tanh") rna.setImputDimNeurons(30) rna.setNumberNeuronsHiddenLayer(31) rna.setActivationFunctionHiddenLayer("tanh") rna.setNumberNeuronsOutputLayer(1) rna.setActivationFunctionOutputLayer("tanh") rna_classifier = RnaClassifier() rna_classifier.setRna(rna) #PREPROCESSADOR PARA ATRIBUTOS CATEGORICOS preprocessor = Preprocessor() preprocessor.setColumnsCategory(['protocol_type', 'service', 'flag']) evaluate = EvaluateModule()
#CONFIGURACAO DA NAIVEBAYES naive_bayes = NaiveBayesModule() naive_bayes_classifier = NaiveBayesClassifier() naive_bayes_classifier.setNaiveBayes(naive_bayes) #CONFIGURACAO DO LSTM lstm = LstmModule() lstm.setInputLength(20) lstm.setNumberExamples(1000) lstm_classifier = LstmClassifier() lstm_classifier.setLstm(lstm) #CONFIGURACAO DA REDE NEURAL rna = RnaModule() rna.setNumberNeuronsImputLayer(78) rna.setActivationFunctionImputLayer("tanh") rna.setImputDimNeurons(78) rna.setNumberNeuronsHiddenLayer(78) rna.setActivationFunctionHiddenLayer("tanh") rna.setNumberNeuronsOutputLayer(1) rna.setActivationFunctionOutputLayer("tanh") rna_classifier = RnaClassifier() rna_classifier.setRna(rna) ''' #METODO HIBRIDO hybrid_classifier = HybridClassifier() hybrid_classifier.setPercentilFaixaSup(25) hybrid_classifier.setPercentilFaixaInf(100) hybrid_classifier.setRna(rna) hybrid_classifier.setKnn(knn)
sys.path.append(os.path.dirname(os.path.realpath(__file__)) + "/../../../knn") from knn_classifier import KnnClassifier from cross_validation import CrossValidation from preprocessor import Preprocessor from hybrid_classifier import HybridClassifier from rna_module import RnaModule from knn_module import KnnModule from evaluate_module import EvaluateModule from dataSet import DataSet dts = DataSet() dts.setFilePath("bases/sub_bases/") #CONFIGURACAO DA REDE NEURAL rna = RnaModule() rna.setNumberNeuronsImputLayer(41) rna.setActivationFunctionImputLayer("tanh") rna.setImputDimNeurons(41) rna.setNumberNeuronsHiddenLayer(42) rna.setActivationFunctionHiddenLayer("tanh") rna.setNumberNeuronsOutputLayer(1) rna.setActivationFunctionOutputLayer("tanh") rna_classifier = RnaClassifier() rna_classifier.setRna(rna) #PREPROCESSADOR PARA ATRIBUTOS CATEGORICOS preprocessor = Preprocessor() preprocessor.setColumnsCategory(['protocol_type','service','flag']) evaluate = EvaluateModule()
from knn_module import KnnModule from evaluate_module import EvaluateModule from dataSet import DataSet dts = DataSet() dts.setFilePath("bases/sub_bases/") #CONFIGURACAO DO KNN knn = KnnModule() knn.setKNeighbors(1) knn_classifier = KnnClassifier() knn_classifier.setKnn(knn) #CONFIGURACAO DA REDE NEURAL rna = RnaModule() rna.setNumberNeuronsImputLayer(12) rna.setActivationFunctionImputLayer("tanh") rna.setImputDimNeurons(12) rna.setNumberNeuronsHiddenLayer(13) rna.setActivationFunctionHiddenLayer("tanh") rna.setNumberNeuronsOutputLayer(1) rna.setActivationFunctionOutputLayer("tanh") rna_classifier = RnaClassifier() rna_classifier.setRna(rna) #METODO HIBRIDO hybrid_classifier = HybridClassifier() #hybrid_classifier.setLowerThreshold(-0.40) #hybrid_classifier.setUpperThreshold(0.99) hybrid_classifier.setPercentilFaixaSup(00) hybrid_classifier.setPercentilFaixaInf(25)