Re: [R] how to preserve trained model in LDA?

From: Prof Brian Ripley <>
Date: Thu, 31 May 2007 07:27:57 +0100 (BST)

On Wed, 30 May 2007, Feng Qiu wrote:

> Hi all:
> I'm developing an application in which I use standard data to
> train the model in LDA and use the trained model to predict on test data. I
> can't train the model every time when I do prediction. So I need to save the
> trained model onto disk after the first training. Does anybody have idea
> about this? You help is highly appreciated.

The object lda() returns (assuming you are using lda) is all you need to do prediction. So just use save() to 'save it to disk', and load() to retrieve it when you need it again.

Brian D. Ripley,        
Professor of Applied Statistics,
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595

______________________________________________ mailing list
PLEASE do read the posting guide
and provide commented, minimal, self-contained, reproducible code.
Received on Thu 31 May 2007 - 06:40:33 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 31 May 2007 - 07:33:19 GMT.

Mailing list information is available at Please read the posting guide before posting to the list.