Exemplo n.º 1
0
        internal void RequestTraining(IObservationSet trainingSet, LearningOptions options)
        {
            if (trainingSet == null)
            {
                throw new ArgumentNullException();
            }

            ILearningTask learningTask
                = new LearningTask(
                    Guid.NewGuid().ToString(),
                    trainingSet,
                    options);

            learningTask.BayesianNetworkStarted += OnLearningStarted;
            learningTask.BayesianNetworkFinished += OnLearningFinished;

            Model.LearningTasks.Clear();
            Model.LearningTasks.Add(learningTask);

            xLearningInspector.SetIsLearning(true);
        }
Exemplo n.º 2
0
 public LearningTask(string id, IObservationSet trainingSet, LearningOptions options)
 {
     Id          = id;
     TrainingSet = trainingSet;
     Options     = options;
 }
Exemplo n.º 3
0
        private void xButtonLearn_Click(object sender, RoutedEventArgs e)
        {
            var trainingSet = _trainingSet;
            if (trainingSet == null)
            {
                return;
            }

            LearningOptions options = new LearningOptions();

            // Prior
            options.DistributionDirichletAlpha = _dirichletAlpha;

            // Structure
            if (xRadStructureDisconnected.IsChecked == true)
            {
                options.Structure = LearningOptions.StructureEnum.DisconnectedStructure;
            }
            else if (xRadStructureRandom.IsChecked == true)
            {
                options.Structure = LearningOptions.StructureEnum.RandomStructure;
                options.StructureSeed =
                    (int)
                    DateTime.UtcNow
                    .Subtract(DateTime.UtcNow.Date)
                    .TotalMilliseconds;
            }
            else if (xRadStructureTree.IsChecked == true)
            {
                options.Structure = LearningOptions.StructureEnum.TreeStructure;
            }
            else if (xRadStructureGeneral.IsChecked == true)
            {
                options.Structure = LearningOptions.StructureEnum.GeneralStructure;
            }
            else
            {
                return;
            }

            // Parent limit
            options.StructureParentLimit = _parentLimit;

            App.Current.MainWindow.RequestTraining(trainingSet, options);
        }
Exemplo n.º 4
0
 public LearningTask(string id, IObservationSet trainingSet, LearningOptions options)
 {
     Id = id;
     TrainingSet = trainingSet;
     Options = options;
 }