Package org.deeplearning4j.nn.api
Interface Classifier
-
- All Superinterfaces:
Model
- All Known Subinterfaces:
IOutputLayer
- All Known Implementing Classes:
BaseOutputLayer
,CenterLossOutputLayer
,Cnn3DLossLayer
,CnnLossLayer
,LossLayer
,MultiLayerNetwork
,OCNNOutputLayer
,OutputLayer
,RnnLossLayer
,RnnOutputLayer
,SameDiffOutputLayer
,Yolo2OutputLayer
public interface Classifier extends Model
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description double
f1Score(INDArray examples, INDArray labels)
Returns the f1 score for the given examples.double
f1Score(DataSet data)
Sets the input and labels and returns a score for the prediction wrt true labelsvoid
fit(INDArray examples, int[] labels)
Fit the modelvoid
fit(INDArray examples, INDArray labels)
Fit the modelvoid
fit(DataSet data)
Fit the modelvoid
fit(DataSetIterator iter)
Train the model based on the datasetiteratorint
numLabels()
Deprecated.Will be removed in a future releaseint[]
predict(INDArray examples)
Takes in a list of examples For each row, returns a labelList<String>
predict(DataSet dataSet)
Takes in a DataSet of examples For each row, returns a label-
Methods inherited from interface org.deeplearning4j.nn.api.Model
addListeners, applyConstraints, batchSize, clear, close, computeGradientAndScore, conf, fit, fit, getGradientsViewArray, getOptimizer, getParam, gradient, gradientAndScore, init, input, numParams, numParams, params, paramTable, paramTable, score, setBackpropGradientsViewArray, setConf, setListeners, setListeners, setParam, setParams, setParamsViewArray, setParamTable, update, update
-
-
-
-
Method Detail
-
f1Score
double f1Score(DataSet data)
Sets the input and labels and returns a score for the prediction wrt true labels- Parameters:
data
- the data to score- Returns:
- the score for the given input,label pairs
-
f1Score
double f1Score(INDArray examples, INDArray labels)
Returns the f1 score for the given examples. Think of this to be like a percentage right. The higher the number the more it got right. This is on a scale from 0 to 1.- Parameters:
examples
- te the examples to classify (one example in each row)labels
- the true labels- Returns:
- the scores for each ndarray
-
numLabels
@Deprecated int numLabels()
Deprecated.Will be removed in a future releaseReturns the number of possible labels- Returns:
- the number of possible labels for this classifier
-
fit
void fit(DataSetIterator iter)
Train the model based on the datasetiterator- Parameters:
iter
- the iterator to train on
-
predict
int[] predict(INDArray examples)
Takes in a list of examples For each row, returns a label- Parameters:
examples
- the examples to classify (one example in each row)- Returns:
- the labels for each example
-
predict
List<String> predict(DataSet dataSet)
Takes in a DataSet of examples For each row, returns a label- Parameters:
dataSet
- the examples to classify- Returns:
- the labels for each example
-
fit
void fit(INDArray examples, INDArray labels)
Fit the model- Parameters:
examples
- the examples to classify (one example in each row)labels
- the example labels(a binary outcome matrix)
-
fit
void fit(DataSet data)
Fit the model- Parameters:
data
- the data to train on
-
fit
void fit(INDArray examples, int[] labels)
Fit the model- Parameters:
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
-
-