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!
"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
> 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 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!
> 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 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!
Public Submission Policy
NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for
all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content.
Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available
via MATLAB Central. Read the complete Disclaimer prior to use.