private static void GMNabclassifier_OnPostColonyIteration(object sender, EventArgs e) { ABCMinerGMN miner = sender as ABCMinerGMN; Console.WriteLine("------------------------"); Console.WriteLine("Iteration [" + miner.CurrentIteration.ToString() + "]"); Console.WriteLine("------------------------"); Console.WriteLine("Iteration Best: " + Math.Round(miner.IterationBestQuality, 5).ToString()); Console.WriteLine("Global Best: " + Math.Round(miner.BestQuality, 5).ToString()); Console.WriteLine("------------------------"); }
public static BayesianMultinetClassifier CreateGMNAntBayesianClassification(int seed, int iterations, int colonySize, int convergence, int dependencies, Dataset trainingSet, ISolutionQualityEvaluator <Edge> qualityEvaluator, IHeuristicValueCalculator <Edge> calculator, bool fireEvents) { DataMining.Utilities.RandomUtility.Initialize(seed); CyclicRelationInvalidator invalidator = new CyclicRelationInvalidator(); BackwardRemovalLocalSearch localSearch = new BackwardRemovalLocalSearch(qualityEvaluator); Problem <Edge> problem = new Problem <Edge>(invalidator, calculator, qualityEvaluator, localSearch); ABCMinerGMN mnabcminer = new ABCMinerGMN(iterations, colonySize, convergence, problem, dependencies, trainingSet); if (fireEvents) { mnabcminer.OnPostAntSolutionContruction += new EventHandler(abclassifier_OnPostAntSolutionContruction); mnabcminer.OnPostColonyIteration += new EventHandler(GMNabclassifier_OnPostColonyIteration); } mnabcminer.Work(); BayesianNetworks.Model.BayesianMultinetClassifier mnbclassifier = mnabcminer.MultinetBayesianClassifier; return(mnbclassifier); }