public class LogisticModelParameters extends Object implements org.apache.hadoop.io.Writable
| Constructor and Description |
|---|
LogisticModelParameters() |
| Modifier and Type | Method and Description |
|---|---|
OnlineLogisticRegression |
createRegression()
Creates a logistic regression trainer using the parameters collected here.
|
CsvRecordFactory |
getCsvRecordFactory()
Returns a CsvRecordFactory compatible with this logistic model.
|
double |
getLambda() |
double |
getLearningRate() |
int |
getMaxTargetCategories() |
int |
getNumFeatures() |
List<String> |
getTargetCategories() |
String |
getTargetVariable() |
Map<String,String> |
getTypeMap() |
static LogisticModelParameters |
loadFrom(File in)
Reads a model from a file.
|
static LogisticModelParameters |
loadFrom(InputStream in)
Reads a model from a stream.
|
void |
readFields(DataInput in) |
void |
saveTo(OutputStream out)
Saves a model to an output stream.
|
void |
setLambda(double lambda) |
void |
setLearningRate(double learningRate) |
void |
setMaxTargetCategories(int maxTargetCategories)
Sets the number of target categories to be considered.
|
void |
setNumFeatures(int numFeatures) |
void |
setTargetCategories(List<String> targetCategories) |
void |
setTargetVariable(String targetVariable)
Sets the target variable.
|
void |
setTypeMap(Iterable<String> predictorList,
List<String> typeList)
Sets the types of the predictors.
|
void |
setTypeMap(Map<String,String> map) |
void |
setUseBias(boolean useBias) |
boolean |
useBias() |
void |
write(DataOutput out) |
public CsvRecordFactory getCsvRecordFactory()
public OnlineLogisticRegression createRegression()
public void saveTo(OutputStream out) throws IOException
IOExceptionpublic static LogisticModelParameters loadFrom(InputStream in) throws IOException
IOExceptionpublic static LogisticModelParameters loadFrom(File in) throws IOException
IOException - If there is an error opening or closing the file.public void write(DataOutput out) throws IOException
write in interface org.apache.hadoop.io.WritableIOExceptionpublic void readFields(DataInput in) throws IOException
readFields in interface org.apache.hadoop.io.WritableIOExceptionpublic void setTypeMap(Iterable<String> predictorList, List<String> typeList)
predictorList - The list of variable names.typeList - The list of types in the format preferred by CsvRecordFactory.public void setTargetVariable(String targetVariable)
targetVariable - The name of the target variable.public void setMaxTargetCategories(int maxTargetCategories)
maxTargetCategories - The number of target categories.public void setNumFeatures(int numFeatures)
public void setUseBias(boolean useBias)
public boolean useBias()
public String getTargetVariable()
public int getNumFeatures()
public int getMaxTargetCategories()
public double getLambda()
public void setLambda(double lambda)
public double getLearningRate()
public void setLearningRate(double learningRate)
Copyright © 2008–2013 The Apache Software Foundation. All rights reserved.