public final class LogisticRegression extends AbstractClassifier
| Constructor and Description |
|---|
LogisticRegression(double lambda,
Minimizer minimizer,
int numIterations,
boolean verbose)
Creates a new logistic regression.
|
LogisticRegression(de.jungblut.math.DoubleVector theta)
Creates a new logistic regression by already existing parameters.
|
| Modifier and Type | Method and Description |
|---|---|
de.jungblut.math.DoubleVector |
getTheta() |
de.jungblut.math.DoubleVector |
predict(de.jungblut.math.DoubleVector features)
Classifies the given features.
|
void |
train(de.jungblut.math.DoubleVector[] features,
de.jungblut.math.DoubleVector[] outcome)
Trains this classifier with the given features and the outcome.
|
trainextractPredictedClass, extractPredictedClass, predictedClass, predictedClass, predictProbabilityclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitasClassifier, extractPredictedClass, extractPredictedClass, predictedClass, predictedClass, predictProbabilitypublic LogisticRegression(double lambda,
Minimizer minimizer,
int numIterations,
boolean verbose)
lambda - the regularization parameter.minimizer - the minimizer to use to train this model.numIterations - the number of iterations to make.verbose - output the progress to STDOUT if true.public LogisticRegression(de.jungblut.math.DoubleVector theta)
public void train(de.jungblut.math.DoubleVector[] features,
de.jungblut.math.DoubleVector[] outcome)
Classifiertrain in interface Classifiertrain in class AbstractClassifieroutcome - the outcome must have classes labeled as doubles. E.G. in
the binary case you have a single element and decide between 0d
and 1d. In higher dimensional cases you have each of these single
elements mapped to a dimension.public de.jungblut.math.DoubleVector predict(de.jungblut.math.DoubleVector features)
Predictorpublic de.jungblut.math.DoubleVector getTheta()
Copyright © 2016. All rights reserved.