Thanks for the reply Ted,

my application is a test application which predicts the probability that a patient has a cancer. I use only two predictors and have only 12 training examples.

It seems to me that LogisticModelparameters persists the logistic regression model as a binary file (sometimes the model consists of many unreadable charachters). I also tried ModelSerializer.writeBinary() with the same result.

The persisted model for the donut-example looks like this (seems to be binary too):

colorynumericxnumeric21?6��C-@I@I?�����+
ic��b��Z����#org.apache.mahout.classifier.sgd.L1@4@4@4@4@4@4@4@4@4@4@�h@4@4@�h@4@4@4@�h@4@4@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B@�B

Can't we simply use XML encoder to persist the model as XML? :
/
FileOutputStream os = new FileOutputStream(LOGISTIC_MODEL+".xml");
XMLEncoder encoder = new XMLEncoder(os);
encoder.writeObject(myLogisticModel)/

This would be much more human-readable :).

Many thanks,

Svetlomir.



Am 06.06.2011 13:57, schrieb Ted Dunning:
Svetlomir,

Can you say more about your application?

Would it be possible to move to using the ModelSerialization style?  The
LogisticModelParameters style is fairly limited insofar as what it can do.

On Thu, Jun 2, 2011 at 5:01 PM, Svetlomir Kasabov<
[email protected]>  wrote:

Hello,

since I updated my trunk version of Mahout today, I get an empty file for
the model when executing this code:

/    OutputStream modelOutput = new FileOutputStream(LOGISTIC_MODEL);
     try {
           this.lmp.saveTo(modelOutput);
     } finally {
           modelOutput.close();
     }

Do you know what can be the problem?

Many thanks,

Svetlomir.
/




Reply via email to