org.apache.mahout.classifier.sgd
Class LogisticModelParameters.MatrixTypeAdapter

java.lang.Object
  extended by org.apache.mahout.classifier.sgd.LogisticModelParameters.MatrixTypeAdapter
All Implemented Interfaces:
com.google.gson.InstanceCreator<Matrix>, com.google.gson.JsonDeserializer<Matrix>, com.google.gson.JsonSerializer<Matrix>
Enclosing class:
LogisticModelParameters

public static class LogisticModelParameters.MatrixTypeAdapter
extends Object
implements com.google.gson.JsonDeserializer<Matrix>, com.google.gson.JsonSerializer<Matrix>, com.google.gson.InstanceCreator<Matrix>

Tells GSON how to (de)serialize a Mahout matrix. We assume on deserialization that the matrix is dense.


Constructor Summary
LogisticModelParameters.MatrixTypeAdapter()
           
 
Method Summary
 Matrix createInstance(Type type)
           
 Matrix deserialize(com.google.gson.JsonElement x, Type type, com.google.gson.JsonDeserializationContext jsonDeserializationContext)
           
 com.google.gson.JsonElement serialize(Matrix m, Type type, com.google.gson.JsonSerializationContext jsonSerializationContext)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LogisticModelParameters.MatrixTypeAdapter

public LogisticModelParameters.MatrixTypeAdapter()
Method Detail

serialize

public com.google.gson.JsonElement serialize(Matrix m,
                                             Type type,
                                             com.google.gson.JsonSerializationContext jsonSerializationContext)
Specified by:
serialize in interface com.google.gson.JsonSerializer<Matrix>

deserialize

public Matrix deserialize(com.google.gson.JsonElement x,
                          Type type,
                          com.google.gson.JsonDeserializationContext jsonDeserializationContext)
Specified by:
deserialize in interface com.google.gson.JsonDeserializer<Matrix>

createInstance

public Matrix createInstance(Type type)
Specified by:
createInstance in interface com.google.gson.InstanceCreator<Matrix>


Copyright © 2008-2010 The Apache Software Foundation. All Rights Reserved.