public void EPI_FullFeatureSet_ICDF() { this.AppIdentTestContext = new AppIdentTestContext(nameof(this.EPI_FullFeatureSet_ICDF)) { MinFlows = 10, FeatureSelectionTreshold = 0.5, TrainingToVerificationRation = 0.7 }; var pcapSource = new AppIdentPcapSource(); var featureSelector = new FeatureSelector(); pcapSource.AddTesting(@"D:\pcaps\AppIdent-TestingData\captured\", "*.cap|*.pcap", true); this.AppIdentTestContext.Save(pcapSource); foreach (var pcap in pcapSource.TestingPcaps) { this.ProcessPcapFile(pcap); } var appIdentDataSource = this.AppIdentService.CreateAppIdentDataSource(this.L7Conversations, this.AppIdentTestContext.MinFlows, this.AppIdentTestContext.TrainingToVerificationRation); var classificationStatisticsMeter = this.AppIdentService.EpiClasify(appIdentDataSource, featureSelector, this.AppIdentTestContext); classificationStatisticsMeter.PrintResults(); this.AppIdentTestContext.Save(classificationStatisticsMeter); this.AppIdentTestContext.Save(); }
public void EPI_FeatureSelection_fast() { this.AppIdentTestContext = new AppIdentTestContext(nameof(this.EPI_FeatureSelection_fast)) { MinFlows = 10, FeatureSelectionTreshold = 0.5, TrainingToVerificationRation = 0.7 }; this.ProcessPcapFile(SnoopersPcaps.Default.app_identification_streamSkypeHttpTls_cap); var appIdentDataSource = this.AppIdentService.CreateAppIdentDataSource(this.L7Conversations, this.AppIdentTestContext.MinFlows, this.AppIdentTestContext.TrainingToVerificationRation); var featureSelector = this.AppIdentService.EliminateCorelatedFeatures(appIdentDataSource, this.AppIdentTestContext.FeatureSelectionTreshold, this.AppIdentTestContext); this.L7Conversations.Clear(); var pcapSource = new AppIdentPcapSource(); pcapSource.AddTesting(@"D:\pcaps\AppIdent-TestingData\captured\", "*.cap|*.pcap", true); this.AppIdentTestContext.Save(pcapSource); foreach (var pcap in pcapSource.TestingPcaps) { this.ProcessPcapFile(pcap); } appIdentDataSource = this.AppIdentService.CreateAppIdentDataSource(this.L7Conversations, this.AppIdentTestContext.MinFlows, this.AppIdentTestContext.TrainingToVerificationRation); var classificationStatisticsMeter = this.AppIdentService.EpiClasify(appIdentDataSource, featureSelector, this.AppIdentTestContext); classificationStatisticsMeter.PrintResults(); this.AppIdentTestContext.Save(); }
public void CreateApplicationProtocolModels_particioning_CreateDataSource() { this.AppIdentTestContext = new AppIdentTestContext(nameof(this.CreateApplicationProtocolModels_particioning_CreateDataSource)) { MinFlows = 30, TrainingToVerificationRation = 1, }; var pcapSource = new AppIdentPcapSource(); pcapSource.AddTesting(@"D:\pcaps\AppIdent-TestingData\captured\", "*.cap|*.pcap", true); this.AppIdentTestContext.Save(pcapSource); foreach (var pcap in pcapSource.TestingPcaps) { this.ProcessPcapFile(pcap); } var appIdentDataSource = this.AppIdentService.CreateAppIdentDataSource(this.L7Conversations, this.AppIdentTestContext.MinFlows, this.AppIdentTestContext.TrainingToVerificationRation); this.AppIdentTestContext.Save(appIdentDataSource); }
public void RandomForestsCrossValidationTest_LearnCompletelyDifferentPcap_ICDF() { this.AppIdentTestContext = new AppIdentTestContext(nameof(this.RandomForestsCrossValidationTest_LearnCompletelyDifferentPcap_ICDF)) { MinFlows = 10, FeatureSelectionTreshold = 0.5, CrossValidationFolds = 2 }; var pcapSource = new AppIdentPcapSource(); pcapSource.AddTesting(@"D:\pcaps\AppIdent-TestingData\captured\pc_13\20-4\data0.cap"); pcapSource.AddVerification(@"D:\pcaps\AppIdent-TestingData\captured\", "*.cap|*.pcap", true); this.AppIdentTestContext.Save(pcapSource); foreach (var pcap in pcapSource.TestingPcaps) { this.ProcessPcapFile(pcap); } var appIdentDataSource = this.AppIdentService.CreateAppIdentDataSource(this.L7Conversations, this.AppIdentTestContext.MinFlows); var featureSelector = this.AppIdentService.EliminateCorelatedFeatures(appIdentDataSource, this.AppIdentTestContext.FeatureSelectionTreshold, this.AppIdentTestContext); var bestParameters = this.AppIdentService.RandomForestGetBestParameters(appIdentDataSource, featureSelector, this.AppIdentTestContext); this.L7Conversations.Clear(); foreach (var pcap in pcapSource.VerificationPcaps) { this.ProcessPcapFile(pcap); } appIdentDataSource = this.AppIdentService.CreateAppIdentDataSource(this.L7Conversations, this.AppIdentTestContext.MinFlows); var classificationStatisticsMeter = this.AppIdentService.RandomForestCrossValidation(appIdentDataSource, featureSelector, bestParameters, this.AppIdentTestContext.CrossValidationFolds, this.AppIdentTestContext); classificationStatisticsMeter.PrintResults(); this.AppIdentTestContext.Save(); }