コード例 #1
0
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()

cross = CrossValidation()

#DEFINIR A ITERACAO QUE O CROSS VALIDATION ESTA
コード例 #2
0
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()

cross = CrossValidation()

#DEFINIR A ITERACAO QUE O CROSS VALIDATION ESTA
コード例 #3
0
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)

'''
#PREPROCESSADOR PARA ATRIBUTOS CATEGORICOS
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(20)
rna.setActivationFunctionImputLayer("tanh")
rna.setImputDimNeurons(20)
rna.setNumberNeuronsHiddenLayer(20)
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(75)
hybrid_classifier.setRna(rna)
hybrid_classifier.setKnn(knn)

#PREPROCESSADOR PARA ATRIBUTOS CATEGORICOS
preprocessor = Preprocessor()
コード例 #5
0
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)
#hybrid_classifier.setLimiteFaixaInf(-0.2)
#hybrid_classifier.setLimiteFaixaSup(0.1)
hybrid_classifier.setRna(rna)