internal void CommitValues(FeatureBasedDCM model)
 {
     model.TrainingPointSpacing     = TrainingPointSpacing;
     model.FeatureDistanceThreshold = FeatureDistanceThreshold;
     model.NegativePointStandoff    = NegativePointStandoff;
     model.Classifier = Classifier;
     model.Features   = Features;
 }
        public new static IEnumerable <Feature> GetAvailableFeatures(Area area)
        {
            foreach (Feature f in FeatureBasedDCM.GetAvailableFeatures(area))
            {
                yield return(f);
            }

            foreach (TimeSliceFeature f in Enum.GetValues(typeof(TimeSliceFeature)))
            {
                yield return(new Feature(typeof(TimeSliceFeature), f, null, null, f.ToString(), null));
            }

            IFeatureExtractor externalFeatureExtractor = InitializeExternalFeatureExtractor(typeof(TimeSliceDCM));

            if (externalFeatureExtractor != null)
            {
                foreach (Feature f in externalFeatureExtractor.GetAvailableFeatures(area))
                {
                    yield return(f);
                }
            }
        }
        private void ok_Click(object sender, EventArgs e)
        {
            string errors = discreteChoiceModelOptions.ValidateInput() + featureBasedDcmOptions.ValidateInput();

            if (errors != "")
            {
                MessageBox.Show(errors);
                return;
            }

            _resultingModel = featureBasedDcmOptions.FeatureBasedDCM;
            if (_resultingModel == null)
            {
                _resultingModel = new FeatureBasedDCM();
            }

            discreteChoiceModelOptions.CommitValues(_resultingModel);
            featureBasedDcmOptions.CommitValues(_resultingModel);

            DialogResult = System.Windows.Forms.DialogResult.OK;
            Close();
        }
        public void Populate(FeatureBasedDCM m)
        {
            Items.Clear();

            if (m != null)
            {
                Items.Add(m.Classifier);
                SetSelected(Items.IndexOf(m.Classifier), true);
            }

            foreach (Classifier available in Classifier.Available)
            {
                if (Items.Cast <Classifier>().Count(present => present.GetType().Equals(available.GetType())) == 0)
                {
                    Items.Add(available);
                }
            }

            if (SelectedItem == null && Items.Count > 0)
            {
                SelectedIndex = 0;
            }
        }
Exemple #5
0
 public RandomForest(bool runFeatureSelection, FeatureBasedDCM model, int numTrees)
     : base(runFeatureSelection, model)
 {
     _numTrees = numTrees;
 }
 public LibLinear(bool runFeatureSelection, FeatureBasedDCM model, PositiveClassWeighting positiveClassWeighting)
     : base(runFeatureSelection, model)
 {
     _positiveClassWeighting = positiveClassWeighting;
 }
 public SvmRank(bool runFeatureSelection, FeatureBasedDCM model, float c)
     : base(runFeatureSelection, model)
 {
     _c = c;
 }
 public FeatureBasedDcmForm(FeatureBasedDCM current)
     : this()
 {
     discreteChoiceModelOptions.DiscreteChoiceModel = featureBasedDcmOptions.FeatureBasedDCM = current;
 }
        public FeatureBasedDcmForm()
        {
            InitializeComponent();

            discreteChoiceModelOptions.trainingAreas.SelectedValueChanged += (o, e) =>
            {
                featureBasedDcmOptions.TrainingArea = discreteChoiceModelOptions.TrainingArea;
            };

            featureBasedDcmOptions.GetFeatures = new Func <Area, List <Feature> >(a => FeatureBasedDCM.GetAvailableFeatures(a).ToList());

            discreteChoiceModelOptions.RefreshAreas();
        }
 public AdaBoost(bool runFeatureSelection, FeatureBasedDCM model, int iterations)
     : base(runFeatureSelection, model)
 {
     _iterations = iterations;
 }
 protected Classifier(bool runFeatureSelection, FeatureBasedDCM model)
 {
     _model = model;
     _runFeatureSelection     = runFeatureSelection;
     _numFeaturesInEachVector = -1;
 }