Beispiel #1
0
 public void PreConfig()
 {
     Classifier = new MulticlassSupportVectorMachineClassifier();
     Classifier.Load("Modules/HGR/MyoGym_SVM");
     AllFeatures = new DataInFeatureOut(MyoVirtualSensor.GetConfiguration().Reader, MyoVirtualSensor.GetConfiguration().Features);
     Decision    = new FeaturesInDecisionOut(new List <IFusionStrategy>()
     {
         AllFeatures
     }, Classifier);
 }
Beispiel #2
0
        static void MyoGym_no_acc()
        {
            FeatureManager featureManager = new FeatureManager();
            var            Classifier     = new MulticlassSupportVectorMachineClassifier();

            Classifier.Load("C:\\Users\\riz\\Desktop\\MyoGYm\\MyoGym_NOEMG_SVM");
            var dataReader = new MQTTReader <double[]>("/i5/myo/full", (dynamic output) =>
            {
                var FeaturSpace = FeatureManager.Generate(output, new List <IFeature>()
                {
                    new HjorthParameters(0, 1, 2),
                    new StandardDeviation(0, 1, 2),
                    new Mean(0, 1, 2),
                    new Max(0, 1, 2),
                    new Min(0, 1, 2),
                    new Percentile(5, 0, 1, 2),
                    new Percentile(10, 0, 1, 2),
                    new Percentile(25, 0, 1, 2),
                    new Percentile(50, 0, 1, 2),
                    new Percentile(75, 0, 1, 2),
                    new Percentile(90, 0, 1, 2),
                    new Percentile(95, 0, 1, 2),
                    new ZeroCrossing(0, 1, 2),
                    new MeanCrossing(0, 1, 2),
                    new Entropy(0, 1, 2),
                    new Correlation(0, 1),
                    new Correlation(0, 2),
                    new Correlation(1, 2),

                    new HjorthParameters(3, 4, 5),
                    new StandardDeviation(3, 4, 5),
                    new Mean(3, 4, 5),
                    new Max(3, 4, 5),
                    new Min(3, 4, 5),
                    new Percentile(5, 3, 4, 5),
                    new Percentile(10, 3, 4, 5),
                    new Percentile(25, 3, 4, 5),
                    new Percentile(50, 3, 4, 5),
                    new Percentile(75, 3, 4, 5),
                    new Percentile(90, 3, 4, 5),
                    new Percentile(95, 3, 4, 5),
                    new ZeroCrossing(3, 4, 5),
                    new MeanCrossing(3, 4, 5),
                    new Entropy(3, 4, 5)
                });

                Console.WriteLine(Classifier.Classify(FeaturSpace));
            });

            dataReader.Add(new SlidingWindow <double[]>(200, 0));
            dataReader.Start();
        }
Beispiel #3
0
 public void PreConfig()
 {
     Classifier = new MulticlassSupportVectorMachineClassifier();
     Classifier.Load("XORModule1");
     Feature1         = new DataInFeatureOut(BinaryOne.GetConfiguration().Reader, BinaryOne.GetConfiguration().Features);
     Feature2         = new DataInFeatureOut(BinaryTwo.GetConfiguration().Reader, BinaryTwo.GetConfiguration().Features);
     FilteredFeatures = new FeaturesInFeatureOut(new List <IFusionStrategy>()
     {
         Feature1, Feature2
     });
     Decision = new FeaturesInDecisionOut(new List <IFusionStrategy>()
     {
         FilteredFeatures
     }, Classifier);
 }
Beispiel #4
0
        static void MyoGymFusion()
        {
            var Classifier = new MulticlassSupportVectorMachineClassifier();

            Classifier.Load("C:\\Users\\riz\\Desktop\\MyoGYm\\MyoGym_SVM1");
            var Features = new DataInFeatureOut(new MQTTReader <double[]>("/i5/myo/full", new SlidingWindow <double[]>(200, 0)), new IFeature[] {
                new HjorthParameters(8, 9, 10),
                new StandardDeviation(8, 9, 10),
                new Mean(8, 9, 10),
                new Max(8, 9, 10),
                new Min(8, 9, 10),
                new Percentile(5, 8, 9, 10),
                new Percentile(10, 8, 9, 10),
                new Percentile(25, 8, 9, 10),
                new Percentile(50, 8, 9, 10),
                new Percentile(75, 8, 9, 10),
                new Percentile(90, 8, 9, 10),
                new Percentile(95, 8, 9, 10),
                new ZeroCrossing(8, 9, 10),
                new MeanCrossing(8, 9, 10),
                new Entropy(8, 9, 10),
                new Correlation(9, 10),
                new Correlation(9, 11),
                new Correlation(10, 11),

                new HjorthParameters(11, 12, 13),
                new StandardDeviation(11, 12, 13),
                new Mean(11, 12, 13),
                new Max(11, 12, 13),
                new Min(11, 12, 13),
                new Percentile(5, 11, 12, 13),
                new Percentile(10, 11, 12, 13),
                new Percentile(25, 11, 12, 13),
                new Percentile(50, 11, 12, 13),
                new Percentile(75, 11, 12, 13),
                new Percentile(90, 11, 12, 13),
                new Percentile(95, 11, 12, 13),
                new ZeroCrossing(11, 12, 13),
                new MeanCrossing(11, 12, 13),
                new Entropy(11, 12, 13),

                new StandardDeviation(0, 1, 2, 3, 4, 5, 6, 7),
                new Mean(0, 1, 2, 3, 4, 5, 6, 7),
                new Max(0, 1, 2, 3, 4, 5, 6, 7),
                new Min(0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(5, 0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(10, 0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(25, 0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(50, 0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(75, 0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(90, 0, 1, 2, 3, 4, 5, 6, 7),
                new Percentile(95, 0, 1, 2, 3, 4, 5, 6, 7),

                new SumLargerThan(25, 0, 1, 2, 3, 4, 5, 6, 7),
                new SumLargerThan(50, 0, 1, 2, 3, 4, 5, 6, 7),
                new SumLargerThan(100, 0, 1, 2, 3, 4, 5, 6, 7)
            });
            var Decision = new FeaturesInDecisionOut(new List <IFusionStrategy>()
            {
                Features
            }, Classifier);

            Decision.OnFusionFinished = (decision) =>
            {
                Console.WriteLine(decision);
            };

            Features.Start();
        }
Beispiel #5
0
        static void MyoGym()
        {
            FeatureManager featureManager = new FeatureManager();
            var            Classifier     = new MulticlassSupportVectorMachineClassifier();

            Classifier.Load("C:\\Users\\riz\\Desktop\\MyoGYm\\MyoGym_SVM");
            var dataReader = new MQTTReader <double[]>("/i5/myo/full", (dynamic output) =>
            {
                var FeaturSpace = FeatureManager.Generate(output, new List <IFeature>()
                {
                    new HjorthParameters(8, 9, 10),
                    new StandardDeviation(8, 9, 10),
                    new Mean(8, 9, 10),
                    new Max(8, 9, 10),
                    new Min(8, 9, 10),
                    new Percentile(5, 8, 9, 10),
                    new Percentile(10, 8, 9, 10),
                    new Percentile(25, 8, 9, 10),
                    new Percentile(50, 8, 9, 10),
                    new Percentile(75, 8, 9, 10),
                    new Percentile(90, 8, 9, 10),
                    new Percentile(95, 8, 9, 10),
                    new ZeroCrossing(8, 9, 10),
                    new MeanCrossing(8, 9, 10),
                    new Entropy(8, 9, 10),
                    new Correlation(9, 10),
                    new Correlation(9, 11),
                    new Correlation(10, 11),

                    new HjorthParameters(11, 12, 13),
                    new StandardDeviation(11, 12, 13),
                    new Mean(11, 12, 13),
                    new Max(11, 12, 13),
                    new Min(11, 12, 13),
                    new Percentile(5, 11, 12, 13),
                    new Percentile(10, 11, 12, 13),
                    new Percentile(25, 11, 12, 13),
                    new Percentile(50, 11, 12, 13),
                    new Percentile(75, 11, 12, 13),
                    new Percentile(90, 11, 12, 13),
                    new Percentile(95, 11, 12, 13),
                    new ZeroCrossing(11, 12, 13),
                    new MeanCrossing(11, 12, 13),
                    new Entropy(11, 12, 13),

                    new StandardDeviation(0, 1, 2, 3, 4, 5, 6, 7),
                    new Mean(0, 1, 2, 3, 4, 5, 6, 7),
                    new Max(0, 1, 2, 3, 4, 5, 6, 7),
                    new Min(0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(5, 0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(10, 0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(25, 0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(50, 0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(75, 0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(90, 0, 1, 2, 3, 4, 5, 6, 7),
                    new Percentile(95, 0, 1, 2, 3, 4, 5, 6, 7),

                    new SumLargerThan(25, 0, 1, 2, 3, 4, 5, 6, 7),
                    new SumLargerThan(50, 0, 1, 2, 3, 4, 5, 6, 7),
                    new SumLargerThan(100, 0, 1, 2, 3, 4, 5, 6, 7)
                });

                Console.WriteLine("HGR(" + Classifier.Classify(FeaturSpace) + ")");
            });

            dataReader.Add(new SlidingWindow <double[]>(200, 0));
            dataReader.Start();
        }