Thread Subject: RBF -classifying data

Subject: RBF -classifying data

From: David Cohen

Date: 9 Oct, 2009 17:55:04

Message: 1 of 8

Hello all,
I am new to Matlab.
I have gathered data which consists of 4 inputs and I have classified it to 0 or 1.
I would like to create an approximation function (I think RBF is what I need) in order to take any 4 inputs and be able to evaluate them to 0 or 1.

For example (my gathered data is)
a=1 b=3 c=2 d=5 answer=0
a=1 b=1 c=3 d=7 answer=1
a=3 b=4 c=12 d=5 answer=1
...

Any help will be greatly appreciated.

Subject: RBF -classifying data

From: Novae

Date: 9 Oct, 2009 18:08:02

Message: 2 of 8

Hi David and welcome to Matlab

What you need is a classifier. When you're saying RBF you mean a Radial Basis Function, which is a very popular kernel used in SVM (Support Vector Machine) classification.

A few days ago another user asked for some help with svmclassify and svmtrain (bio-informatics toolbox) and I was glad to provide some help. In my answer I suggested the use of a very popular SVM classification toolbox. Please check my response and follow the same advice:

http://www.mathworks.com/matlabcentral/newsreader/view_thread/262510#685295

Any further question please reply here.

Have fun!

Igor

"David Cohen" <dudu.cohen@gmail.com> wrote in message <hantdo$kq4$1@fred.mathworks.com>...
> Hello all,
> I am new to Matlab.
> I have gathered data which consists of 4 inputs and I have classified it to 0 or 1.
> I would like to create an approximation function (I think RBF is what I need) in order to take any 4 inputs and be able to evaluate them to 0 or 1.
>
> For example (my gathered data is)
> a=1 b=3 c=2 d=5 answer=0
> a=1 b=1 c=3 d=7 answer=1
> a=3 b=4 c=12 d=5 answer=1
> ...
>
> Any help will be greatly appreciated.

Subject: RBF -classifying data

From: David Cohen

Date: 9 Oct, 2009 18:25:19

Message: 3 of 8

Hello Igor and thank you very much for the very fast answer.
Can you please direct me on how to use those functions.
I have uploaded my data to a matrix:

Those are some lines from the file... (I have thousands of lines)
36 53 0.06 336 1
36 33 0.11 29 1
3 88 0.72 182 1
131 18 0.33 371 0
137 15 0.27 381 0

fid = fopen('CornerRank.txt');
a = fscanf(fid,'%g %g %g %g %g',[5 inf])
fclose(fid)

what can I now do with the matrix and your suggested functions?

Thnaks again

Subject: RBF -classifying data

From: David Cohen

Date: 9 Oct, 2009 19:50:18

Message: 4 of 8

Hello All,
I have managed to use the SVMTrain to get an SVMstruct from the data I have.
How can I now extract the parameters for my approximation function (the one which I can use on any other input in order to classify it)?

Subject: RBF -classifying data

From: Novae

Date: 13 Oct, 2009 11:27:03

Message: 5 of 8

Hi again David

I'm glad you managed to work around the usage of the library. Once you manage to feed the input you just have to wait for the train to end. Be sure that the data dimension for train and test agree. I don't know if you're using the bio-informatics toolbox or the other one that I recommended. I don't use the bio-informatics toolbox because I always have multiclass data and not binary. However in theory you always have binary classification: it is of one class or it is not.

SVMTrain will return a structure with some parameters. A structure variable in Matlab can have many fields. Refer to your Matlab help in the structure variables section and you will learn there how to take specific information from a field. In your case your variable is the model and the fields are the model parameters.

Resuming: type YourModelName.FieldName

Igor



"David Cohen" <dudu.cohen@gmail.com> wrote in message <hao45q$f6c$1@fred.mathworks.com>...
> Hello All,
> I have managed to use the SVMTrain to get an SVMstruct from the data I have.
> How can I now extract the parameters for my approximation function (the one which I can use on any other input in order to classify it)?

Subject: RBF -classifying data

From: Bruno Luong

Date: 13 Oct, 2009 12:14:08

Message: 6 of 8

"Novae " <igor.amaral@gmail.com> wrote in message <hb1o67$7n1$1@fred.mathworks.com>...
> I don't use the bio-informatics toolbox because I always have multiclass data and not binary. However in theory you always have binary classification: it is of one class or it is not.

I'm curious, can you just simply replace the multiclass problem with a hierarchy binary classification sub-problems?

Bruno

Subject: RBF -classifying data

From: Novae

Date: 13 Oct, 2009 16:05:23

Message: 7 of 8

Hello Bruno

Yes, I believe you can say that. You can test option A against all other options (B, C, D, ...) one at the time and evaluate your final result by estimating the output probability, for example. Or classify A against all the group (B, C, D, ..) in order to evaluate if such object belongs to A or not. If it belongs than its label is A. If not then test B against A, C, D, etc. You can test them in one-vs-one or one-vs-all.
These classification problems are kind of new to me. So if something I wrotre isn't quite true feel free to correct me. I would appreciate it.

Igor

"Bruno Luong" <b.luong@fogale.findmycountry> wrote in message <hb1qug$4tu$1@fred.mathworks.com>...
> "Novae " <igor.amaral@gmail.com> wrote in message <hb1o67$7n1$1@fred.mathworks.com>...
> > I don't use the bio-informatics toolbox because I always have multiclass data and not binary. However in theory you always have binary classification: it is of one class or it is not.
>
> I'm curious, can you just simply replace the multiclass problem with a hierarchy binary classification sub-problems?
>
> Bruno

Subject: RBF -classifying data

From: Greg

Date: 13 Oct, 2009 23:55:52

Message: 8 of 8

On Oct 9, 1:55 pm, "David Cohen" <dudu.co...@gmail.com> wrote:
> Hello all,
> I am new to Matlab.
> I have gathered data which consists of 4 inputs and I have classified it to 0 or 1.
> I would like to create an approximation function (I think RBF is what I need) in order to take any 4 inputs and be able to evaluate them to 0 or 1.
>
> For example (my gathered data is)
> a=1 b=3 c=2 d=5 answer=0
> a=1 b=1 c=3 d=7 answer=1
> a=3 b=4 c=12 d=5 answer=1
> ...
>
> Any help will be greatly appreciated.

If you have the NN Toolbox you can use either NEWFF or NEWRB
and train with 4 output targets from the columns of eye(4). The
outputs
can then be interpreted as estimates of input conditional posterior
probabilities for the corresponding classes. The input is assigned
(i.e.,
classified as belonging) to the class corresponding to the maximum
posterior. Set answer = 1 for this class and answer = 0 for the other
3.

help newff
doc newff
help newrb
doc newrb

Hope this helps.

Greg

Tags for this Thread

Everyone's Tags:

Add a New Tag:

Separated by commas
Ex.: root locus, bode

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Tag Activity for This Thread
Tag Applied By Date/Time
svmtrain David Cohen 9 Oct, 2009 15:54:03
rbf David Cohen 9 Oct, 2009 15:54:03
svmstruct David Cohen 9 Oct, 2009 15:54:03
classification Novae 9 Oct, 2009 14:09:04
svm Novae 9 Oct, 2009 14:09:04
rssFeed for this Thread

Contact us at files@mathworks.com