Thread Subject: classify and crossvalind function

Subject: classify and crossvalind function

From: Arthur Zheng

Date: 16 Jun, 2008 01:05:06

Message: 1 of 6

hi,
Once I have used classify and crossvalind function for a set
of data for classification,how can I save the model of the
classifier so that next time when new data comes in, I can
classify the data by directly using the saved model and I
don't need to train the model again?
thank you!

Regards,
Arthur

Subject: classify and crossvalind function

From: Arthur Zheng

Date: 16 Jun, 2008 15:14:01

Message: 2 of 6

"Arthur Zheng" <hzheng7@gatech.edu> wrote in message
<g34e82$g3k$1@fred.mathworks.com>...
> hi,
> Once I have used classify and crossvalind function for a set
> of data for classification,how can I save the model of the
> classifier so that next time when new data comes in, I can
> classify the data by directly using the saved model and I
> don't need to train the model again?
> thank you!
>
> Regards,
> Arthur

Subject: classify and crossvalind function

From: Tom Lane

Date: 16 Jun, 2008 22:14:49

Message: 3 of 6

> Once I have used classify and crossvalind function for a set
> of data for classification,how can I save the model of the
> classifier so that next time when new data comes in, I can
> classify the data by directly using the saved model and I
> don't need to train the model again?

Arthur, the classify function is written to classify one set (test set)
based on another set (training set). So you can do what you propose
directly. Is the problem that it's too time consuming to operate on the
training set each time?

Another option is to use the fifth output from the function to evaluate the
classification function for each pair of groups. Maybe that would be
faster.

-- Tom

Subject: classify and crossvalind function

From: Arthur Zheng

Date: 16 Jun, 2008 23:03:02

Message: 4 of 6

"Tom Lane" <tlane@mathworks.com> wrote in message
<g36okp$h61$1@fred.mathworks.com>...
> > Once I have used classify and crossvalind function for a set
> > of data for classification,how can I save the model of the
> > classifier so that next time when new data comes in, I can
> > classify the data by directly using the saved model and I
> > don't need to train the model again?
>
> Arthur, the classify function is written to classify one
set (test set)
> based on another set (training set). So you can do what
you propose
> directly. Is the problem that it's too time consuming to
operate on the
> training set each time?
>
> Another option is to use the fifth output from the
function to evaluate the
> classification function for each pair of groups. Maybe
that would be
> faster.
>
> -- Tom
>
>
Tom, yes,for bioinformatics, the problem is the training set
is too large and it is time-consuming to operate on the
training set each time.
You suggestion is nice. I also guess we can use the fifth
output from the classify function. But there is two problem.
1. How to use the fifth output? Could you give me an
example, say for linear case? 2. How to use the fifth output
combine with crossvalind function? There is no property of
COEFF in the crossvalind function. Thank you!

Subject: classify and crossvalind function

From: Tom Lane

Date: 17 Jun, 2008 13:40:27

Message: 5 of 6

> You suggestion is nice. I also guess we can use the fifth
> output from the classify function. But there is two problem.
> 1. How to use the fifth output? Could you give me an
> example, say for linear case? 2. How to use the fifth output
> combine with crossvalind function? There is no property of
> COEFF in the crossvalind function.

Arthur, type "help classify". If there are two groups I and J, the material
right above the example describes the function you need to compute in order
to decide whether a point is classified as I or J. If you have more groups,
you'll need to do this for pairs of groups and pick the one that "wins"
against all other groups.

I don't understand your second question. If I understand crossvalind
correctly, it just returns train/test sets or indices that define such sets.
You can use those sets with the classify function.

-- Tom

Subject: classify and crossvalind function

From: Arthur Zheng

Date: 17 Jun, 2008 17:28:01

Message: 6 of 6

"Tom Lane" <tlane@mathworks.com> wrote in message
<g38esc$o2s$1@fred.mathworks.com>...
> > You suggestion is nice. I also guess we can use the fifth
> > output from the classify function. But there is two problem.
> > 1. How to use the fifth output? Could you give me an
> > example, say for linear case? 2. How to use the fifth output
> > combine with crossvalind function? There is no property of
> > COEFF in the crossvalind function.
>
> Arthur, type "help classify". If there are two groups I
and J, the material
> right above the example describes the function you need
to compute in order
> to decide whether a point is classified as I or J. If you
have more groups,
> you'll need to do this for pairs of groups and pick the
one that "wins"
> against all other groups.
>
> I don't understand your second question. If I understand
crossvalind
> correctly, it just returns train/test sets or indices that
define such sets.
> You can use those sets with the classify function.
>
> -- Tom
>
>
Tom, it seems complicated to use COEF. The prototype is like
this
CLASS = CLASSIFY(SAMPLE,TRAINING,GROUP,TYPE,PRIOR),
I chose TYPE to be 'linear' and no PRIOR.
I don't know where to put
        'name1' name of first group of pair (group I)
        'name2' name of second group of pair (group J)
        'const' constant term of boundary equation (K)
Where are they? Are they inputs or output? thank you!

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
classify crossv... Arthur Zheng 16 Jun, 2008 11:15:09
rssFeed for this Thread

Contact us at files@mathworks.com