Esempio n. 1
0
        public Experiment(string name, EEGRecord er, AMLearning ml, bool enabled)
        {
            Name     = name;
            _er      = er;
            _ml      = ml;
            _enabled = enabled;

            _ml.Progress += new ChangedValuesEventHandler(_ml_Progress);
        }
Esempio n. 2
0
        public void SaveModel(AMLearning model)
        {
            if (!File.Exists(DbSettings.fullpath + ".eq"))
            {
                db.CreateDatabase(DbSettings.fullpath);
            }

            db.OpenDatabase(DbSettings.fullpath);
            db.RefreshMode = ObjectRefreshMode.AlwaysReturnUpdatedValues;

            db.Store(model);

            db.Close();
        }
Esempio n. 3
0
        private void listBoxModels_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (listBoxModels.SelectedIndex != -1)
            {
                model = models[listBoxModels.SelectedIndex];

                listBoxClasses.Items.Clear();

                foreach (var item in model.ActionList)
                {
                    listBoxClasses.Items.Add(item.Key);
                }
            }
        }
Esempio n. 4
0
        private void buttonCalculate_Click(object sender, EventArgs e)
        {
            //if (AsyncWorkerCalculate.IsBusy)
            //{
            //    buttonCalculate.Enabled = false;

            //    AsyncWorkerCalculate.CancelAsync();
            //}
            //else //start new process
            {
                listBoxLogger.Items.Insert(0, "Creating machine learning model to be used for classification...");
                if (currentRecord.FeatureVectorsOutputInput.Count == 0)
                {
                    MessageBox.Show("First you need to record/load some data for specific action!"); return;
                }

                buttonCalculate.Enabled = false;
                //buttonCalculate.Text = "Cancel";
                startCalculateModel = DateTime.Now;

                switch (cbMethods.SelectedIndex)
                {
                case 0: model = new LdaSVM("ldasvm"); break;

                case 1: model = new LdaMLP("ldamlp"); break;

                case 2: model = new LdaRBF("ldarbf"); break;

                case 3: model = new OctaveMulticlassLogisticRegression("omlr"); break;
                }
                model.ActionList = currentRecord.actions;
                model.Progress  += new ChangedValuesEventHandler(model_Progress);

                AsyncWorkerCalculate.RunWorkerAsync();
            }
        }