Ejemplo n.º 1
0
 public TaskTree(models.Task task,
                 models.Selection[] sel,
                 models.TaskSolver[] per,
                 models.TaskSolver[] desCART,
                 models.TaskSolver[] desC4_5,
                 models.TaskSolver[] wards,
                 models.TaskSolver[] convnets,
                 models.TaskSolver[] kohnets,
                 string[] solv,
                 TaskTreeViewModel vm)
 {
     Title   = task.Name;
     Content = new ObservableCollection <TreeSection>
     {
         new SelectionTree(task, sel, vm),
         new SolverTree(task, per, desCART, desC4_5, wards, convnets, kohnets, vm),
         new SolutionsTree(Title, solv, vm)
     };
     deleteCommand = new ActionHandler(
         () =>
     {
         new dms.services.preprocessing.DataHelper().deleteTask(task);
         vm.UpdateTaskTree();
     }, e => true);
     showInfoDialogCommand = new ActionHandler(() =>
     {
         TaskInfoViewModel t = new TaskInfoViewModel(task);
         vm.SendRequestCreateView(t);
     }, e => true);
     showPreprocessingCreationHandler = new ActionHandler(() =>
     {
         PreprocessingViewModel t = new PreprocessingViewModel(task, -1);
         vm.SendRequestCreateView(t);
     }, e => true);
 }
 public SelectionLeaf(string taskName, string name, TaskTreeViewModel vm)
 {
     Title = name;
     parentTask = taskName;
     deleteHandler = new ActionHandler(() => vm.DeleteSelection(parentTask, Title), e => true);
     showSelectionInfoHandler = new ActionHandler(() => vm.ShowSelectionInfoDialog(parentTask, Title), e => true);
 }
Ejemplo n.º 3
0
 public SolverTree(models.Task task,
                   models.TaskSolver[] per,
                   models.TaskSolver[] desCART,
                   models.TaskSolver[] desC4_5,
                   models.TaskSolver[] wards,
                   models.TaskSolver[] convnets,
                   models.TaskSolver[] kohnets,
                   TaskTreeViewModel vm) : base("Решатели")
 {
     ParentTask = task.Name;
     Content    = new ObservableCollection <TreeSection>
     {
         new PerceptronTree(task, per, vm),
         new DecisionTreesCARTTree(task, desCART, vm),
         new DecisionTreesC4_5Tree(task, desC4_5, vm),
         new WardTree(task, wards, vm),
         new ConvNNTree(task, convnets, vm),
         new KohonenTree(task, kohnets, vm)
     };
     createSolverCommand = new ActionHandler(() =>
     {
         SolverCreationViewModel t = new SolverCreationViewModel(task);
         t.OnClose += (s, p) => vm.UpdateTaskTree();
         vm.SendRequestCreateView(t);
     }, o => true);
 }
Ejemplo n.º 4
0
 public WardTree(models.Task task, models.TaskSolver[] wards,
                 TaskTreeViewModel vm) : base("Сети Ворда", wards.Select(x => x.Name).ToArray())
 {
     Content = new ObservableCollection <TreeSection>();
     for (int i = 0; i < wards.Length; i++)
     {
         Content.Add(new SolverLeaf(task, wards[i], "Нейронная сеть Ворда", vm));
     }
 }
 public SolutionLeaf(string taskName, string name, TaskTreeViewModel vm)
 {
     Title = name;
     showSolutionInfoHandler = new ActionHandler(() =>
     {
         var t = new SolveStatisticViewModel(taskName, name);
         vm.SendRequestCreateView(t);
     }, e => true);
 }
 public SolverTree(string[] per, string[] des, TaskTreeViewModel vm)
     : base("Решатели")
 {
     Content = new ObservableCollection<TreeSection>
     {
         new PerceptronTree(per, vm),
         new DecisionTreesTree(des, vm)
     };
 }
 public KohonenTree(models.Task task, models.TaskSolver[] koh_nets,
                    TaskTreeViewModel vm) : base("Сети Кохонена", koh_nets.Select(x => x.Name).ToArray())
 {
     Content = new ObservableCollection <TreeSection>();
     for (int i = 0; i < koh_nets.Length; i++)
     {
         Content.Add(new SolverLeaf(task, koh_nets[i], "Сеть Кохонена", vm));
     }
 }
Ejemplo n.º 8
0
 public DecisionTreesCARTTree(models.Task task, models.TaskSolver[] trees,
                              TaskTreeViewModel vm) : base("Деревья решений CART", trees.Select(x => x.Name).ToArray())
 {
     Content = new ObservableCollection <TreeSection>();
     for (int i = 0; i < trees.Length; i++)
     {
         Content.Add(new SolverLeaf(task, trees[i], "DecisionTreeCART", vm));
     }
 }
Ejemplo n.º 9
0
 public PerceptronTree(models.Task task, models.TaskSolver[] perceptrons,
                       TaskTreeViewModel vm) : base("Персептроны", perceptrons.Select(x => x.Name).ToArray())
 {
     Content = new ObservableCollection <TreeSection>();
     for (int i = 0; i < perceptrons.Length; i++)
     {
         Content.Add(new SolverLeaf(task, perceptrons[i], "Персептрон", vm));
     }
 }
Ejemplo n.º 10
0
 public ConvNNTree(models.Task task, models.TaskSolver[] convs,
                   TaskTreeViewModel vm) : base("Сверточные НС", convs.Select(x => x.Name).ToArray())
 {
     Content = new ObservableCollection <TreeSection>();
     for (int i = 0; i < convs.Length; i++)
     {
         Content.Add(new SolverLeaf(task, convs[i], "Сверточная нейронная сеть", vm));
     }
 }
Ejemplo n.º 11
0
 public SolverLeaf(models.Task task, models.TaskSolver solver, string solverType,
                   TaskTreeViewModel vm) : base(solver.Name)
 {
     parentTask             = task;
     this.solverType        = solverType;
     this.solver            = solver;
     showSolverInfoHandler  = new ActionHandler(() => vm.SendRequestCreateView(CreateSolverInfoViewModel()), e => true);
     showSolveDialogHandler = new ActionHandler(() => vm.SendRequestCreateView(new SolveViewModel(parentTask, solver)), e => true);
     showLearnDialogHandler = new ActionHandler(() => vm.SendRequestCreateView(new LearnSolverViewModel(parentTask, solver)), e => true);
 }
 public SelectionTree(string taskName, string[] selections, 
     TaskTreeViewModel vm)
     : base("Выборки")
 {
     this.createSelection = new ActionHandler(() => vm.ShowCreateSelectionDialog(taskName), e => true);
     this.deleteSelection = new ActionHandler(() => vm.DeleteSelection(taskName, Title), e => true);
     ParentTask = taskName;
     Content = new ObservableCollection<TreeSection>();
     for(int i = 0; i < selections.Length; i++)
     {
         Content.Add(new SelectionLeaf(taskName, selections[i], vm));
     }
 }
 public SolutionsTree(string taskName, string[] solutions, TaskTreeViewModel vm) : base("Решения", solutions)
 {
     createSolutionHandler = new ActionHandler(() =>
     {
         var t = new CreateSolutionViewModel(taskName);
         vm.SendRequestCreateView(t);
     }, e => true);
     Content = new ObservableCollection <TreeSection>();
     for (int i = 0; i < solutions.Length; i++)
     {
         Content.Add(new SolutionLeaf(taskName, solutions[i], vm));
     }
 }
 public TaskTree(string Name,
     string[] sel, string[] per, string[] des, string[] solv, 
     TaskTreeViewModel vm)
 {
     Title = Name;
     Content = new ObservableCollection<TreeSection>
     {
         new SelectionTree(Title, sel, vm),
         new SolverTree(per, des, vm),
         new SolutionsTree(solv, vm)
     };
     onDelete = vm.DeleteTask;
     showInfoDialog = vm.ShowTaskInfoDialog;
 }
Ejemplo n.º 15
0
        public SelectionTree(models.Task task, models.Selection[] selections,
                             TaskTreeViewModel vm) : base("Выборки")
        {
            createSelection = new ActionHandler(() =>
            {
                SelectionCreationViewModel t = new SelectionCreationViewModel(task.ID, vm);
                vm.SendRequestCreateView(t);
            }, e => true);

            ParentTask = task.Name;
            Content    = new ObservableCollection <TreeSection>();
            for (int i = 0; i < selections.Length; i++)
            {
                int          templateId = selections[i].TaskTemplateID;
                TaskTemplate template   = ((TaskTemplate)dms.services.DatabaseManager.SharedManager.
                                           entityById(templateId, typeof(TaskTemplate)));
                if (template.PreprocessingParameters == null)
                {
                    Content.Add(new SelectionLeaf(task, selections[i], vm));
                }
            }
        }
        public SelectionCreationViewModel(int taskId, TaskTreeViewModel vm)
        {
            taskTreeVM = vm;
            TaskId     = taskId;
            ParentTask = ((models.Task)services.DatabaseManager.SharedManager.entityById(taskId, typeof(models.Task))).Name;
            Random r = new Random();

            SelectionName   = "Выборка " + r.Next(1, 1000);
            NewTemplateName = "New Template";
            HasHeader       = false;
            CountRows       = 0;
            FilePath        = "";
            Delimiter       = ",";
            EnumPercent     = 5;

            browseFileCommandHandler = new ActionHandler(BrowseFile, (o) => true);
            cancelHandler            = new ActionHandler(Cancel, o => true);
            createHandler            = new ActionHandler(Create, o => (CanUseExitingTemplate || CanCreateTemplate));

            Parameters            = new ObservableCollection <ParameterCreationViewModel>();
            CanUseExitingTemplate = CanCreateTemplate = false;
            TemplateList          = new ObservableCollection <string>();
        }
Ejemplo n.º 17
0
 public SelectionLeaf(models.Task task, models.Selection selection, TaskTreeViewModel vm)
 {
     Title         = selection.Name;
     parentTask    = task.Name;
     deleteHandler = new ActionHandler(
         () =>
     {
         new dms.services.preprocessing.DataHelper().deleteSelection(selection);
         vm.UpdateTaskTree();
     }, e => true);
     showSelectionInfoHandler = new ActionHandler(
         () =>
     {
         SelectionInfoViewModel t = new SelectionInfoViewModel(task.ID, selection.ID);
         vm.SendRequestCreateView(t);
     }, e => true);
     showSelectionLearnHandler = new ActionHandler(
         () =>
     {
         var t = new SelectionLearnStatisticViewModel(selection, task.Name);
         vm.SendRequestCreateView(t);
     }, e => true);
 }
 public SolutionsTree(string[] solutions, TaskTreeViewModel vm)
     : base("Решения", solutions)
 {
 }
 public DecisionTreesTree(string[] trees, TaskTreeViewModel vm)
     : base("Деревья решений", trees)
 {
 }
 public PerceptronTree(string[] perceptrons, TaskTreeViewModel vm)
     : base("Персептроны", perceptrons)
 {
 }