public interface Classifier extends Model
Modifier and Type | Method and Description |
---|---|
double |
f1Score(org.nd4j.linalg.dataset.api.DataSet data)
Sets the input and labels and returns a score for the prediction
wrt true labels
|
double |
f1Score(org.nd4j.linalg.api.ndarray.INDArray examples,
org.nd4j.linalg.api.ndarray.INDArray labels)
Returns the f1 score for the given examples.
|
void |
fit(org.nd4j.linalg.dataset.api.DataSet data)
Fit the model
|
void |
fit(org.nd4j.linalg.dataset.api.iterator.DataSetIterator iter)
Train the model based on the datasetiterator
|
void |
fit(org.nd4j.linalg.api.ndarray.INDArray examples,
org.nd4j.linalg.api.ndarray.INDArray labels)
Fit the model
|
void |
fit(org.nd4j.linalg.api.ndarray.INDArray examples,
int[] labels)
Fit the model
|
org.nd4j.linalg.api.ndarray.INDArray |
labelProbabilities(org.nd4j.linalg.api.ndarray.INDArray examples)
Returns the probabilities for each label
for each example row wise
|
int |
numLabels()
Returns the number of possible labels
|
java.util.List<java.lang.String> |
predict(org.nd4j.linalg.dataset.api.DataSet dataSet)
Takes in a DataSet of examples
For each row, returns a label
|
int[] |
predict(org.nd4j.linalg.api.ndarray.INDArray examples)
Takes in a list of examples
For each row, returns a label
|
accumulateScore, applyLearningRateScoreDecay, batchSize, clear, computeGradientAndScore, conf, fit, fit, getOptimizer, getParam, gradient, gradientAndScore, init, initParams, input, iterate, numParams, numParams, params, paramTable, paramTable, score, setBackpropGradientsViewArray, setConf, setListeners, setListeners, setParam, setParams, setParamsViewArray, setParamTable, update, update, validateInput
double f1Score(org.nd4j.linalg.dataset.api.DataSet data)
data
- the data to scoredouble f1Score(org.nd4j.linalg.api.ndarray.INDArray examples, org.nd4j.linalg.api.ndarray.INDArray labels)
examples
- te the examples to classify (one example in each row)labels
- the true labelsint numLabels()
void fit(org.nd4j.linalg.dataset.api.iterator.DataSetIterator iter)
iter
- the iterator to train onint[] predict(org.nd4j.linalg.api.ndarray.INDArray examples)
examples
- the examples to classify (one example in each row)java.util.List<java.lang.String> predict(org.nd4j.linalg.dataset.api.DataSet dataSet)
dataSet
- the examples to classifyorg.nd4j.linalg.api.ndarray.INDArray labelProbabilities(org.nd4j.linalg.api.ndarray.INDArray examples)
examples
- the examples to classify (one example in each row)void fit(org.nd4j.linalg.api.ndarray.INDArray examples, org.nd4j.linalg.api.ndarray.INDArray labels)
examples
- the examples to classify (one example in each row)labels
- the example labels(a binary outcome matrix)void fit(org.nd4j.linalg.dataset.api.DataSet data)
data
- the data to train onvoid fit(org.nd4j.linalg.api.ndarray.INDArray examples, int[] labels)
examples
- the examples to classify (one example in each row)labels
- the labels for each example (the number of labels must match
the number of rows in the example