how can I constrain weights of linear classifier in MATLAB?

1 view (last 30 days)
I am graduate student studying system neuroscience in Korea. I have a problem and need your help... problem is like below.
There are a number of neurons and we know their firing rates on -3s, -2s, -1s, like
neuron index :
1 2 3 4
firing rata
0s: 1 1 -1 1
-1s: -1 -1 0 -1
-2s: 0 0 0 0
-3s: 1 1 1 1
By using these fire rate history, I want to predict current(0s) firing rate of neurons whether it is 1 or -1. I am using linear SVM and varying weights of each time point. But, I want to constrain absolute value of weight of recent firing rate is always larger than that of past like
weight of
-1s: -0.8
-2s: 0.3
-3s: -0.1
How can I realize this idea on linear classifier like linear SVM on MATLAB? (of course, other linear classifier would be welcomed)
please help me...

Answers (1)

Rakesh Chavan
Rakesh Chavan on 4 Jan 2016
Hi,
It is possible to create a linear SVM model using the 'fitcsvm' function based on the training data. http://www.mathworks.com/help/stats/fitcsvm.html
You can use the 'predict' function to for classifying new data using a trained SVM classifier: http://www.mathworks.com/help/stats/compactclassificationsvm.predict.html
A general overview of the process is given in the following link: http://www.mathworks.com/help/stats/support-vector-machines-svm.html
For generating a linear discriminant analysis classifier the 'fitcdiscr' can be used. The weights option for this function can be used to specify custom weights. Kindly refer to the following link: http://www.mathworks.com/help/stats/fitcdiscr.html

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!