Real time classification problem
2 views (last 30 days)
Show older comments
I have data of two different classes (attached xls file) blue is belongs to one class and red is belongs to another class. I need to classify the future real time inputs based on this data. Please suggest me simple classification technique which can be implemented easily in a microcontroller to do this classification task.
0 Comments
Accepted Answer
Neil Caithness
on 22 Jan 2016
Edited: Neil Caithness
on 22 Jan 2016
You could try building a neural net classifier, but there are lots of variations to try and you need to work at it.
Here is a quick start based on your example but you'll need to train it with a much bigger dataset.
xtrain = [
28.1800 100.3800 3.9900 74.4600 371.3400 119.7200 53.7200 93.3400 18.6000
24.0800 24.6900 12.9600 241.5400 46.6600 102.4900 81.8700 5.8200 29.4800
127.6300 19.2300 12.9300 4.0100 6.6700 87.2900 211.8200 50.4200 39.1500
28.7800 117.4000 0.5800 364.8400 8.8000 76.7600 9.3900 77.2200 18.7300
24.4700 70.4800 13.4500 56.0200 101.9400 67.0800 1.9500 48.0800 25.7500
170.8900 20.0300 11.1600 518.9100 620.4600 53.3400 12.0500 46.1600 31.1200
28.1800 188.9000 0.9600 23.4300 66.4900 47.4700 17.2500 77.6800 11.0700
25.8400 106.4900 14.0100 335.3600 0.1300 35.2400 21.6200 90.4800 18.2700
124.9800 17.4800 0.1300 25.2900 1.7700 28.3300 24.5100 87.3500 26.3400
28.8200 180.4300 11.6900 456.7700 72.5900 25.3300 25.8800 5.8600 2.6700
26.4700 137.1700 7.5500 53.8800 585.5100 14.6500 24.3900 71.1500 14.6500
85.8000 24.5400 4.1800 323.0400 81.7500 2.9200 25.8800 48.8500 20.9100
29.2000 18.8800 13.2600 6.5300 1.4400 6.1200 20.1000 41.2500 31.5700
27.4300 228.8500 9.6400 218.6100 1.2300 215.9400 17.8100 77.8500 11.0700
52.5500 75.4800 2.0300 137.0900 52.2600 0.9000 13.1500 87.4100 17.5200
29.1400 19.1600 12.8800 0.3000 528.2600 55.0000 6.2800 87.5800 27.1500
26.1200 191.6500 10.7700 438.6500 122.9700 428.9900 0.8400 7.8600 2.4300
2.1500 95.2400 0.4500 96.7400 3.9400 2.0000 0.3000 70.3200 7.3900
27.4900 19.6400 12.8800 206.3600 2.8500 20.0200 15.0300 51.4400 20.5000
26.5600 160.4900 10.7800 8.0500 36.0200 491.9500 20.3800 43.8700 23.2400
];
ytrain = [
1 1 1 0 0 0 0 0 1
0 0 0 1 1 1 1 1 0
];
net = train(patternnet,xtrain,ytrain);
The net object can then give you predicted classifications for new observations. e.g.
ytest = net(xtest)
ytest =
0.2543 0.1770 0.0810 0.9653 0.0458 0.3848 0.3319 0.0975 0.1332
0.7457 0.8230 0.9190 0.0347 0.9542 0.6152 0.6681 0.9025 0.8668
If you get something that works then there are code builder tools for deployment.
3 Comments
Greg Heath
on 5 Feb 2016
I suggest you try to reduce the number of inputs. The best way for classification is to use PLSREGRESS or even STEPWISEFIT(instead of PCA).
HOPE THIS HELPS.
Greg
More Answers (0)
See Also
Categories
Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!