InputType
- The type of the input data. It is passed to the first learning
algorithm to learn the evaluator that takes this type and returns the
intermediate type.IntermediateType
- The type of the output of the first learned function that is used as
input to the second learner. It is also the input type for the second
learned evaluator that returns the output type.OutputType
- The type of output of the evaluator learned by the second learner. It
is also the output type of the composite evaluator pair.public class CompositeBatchLearnerPair<InputType,IntermediateType,OutputType> extends AbstractCloneableSerializable implements BatchLearner<java.util.Collection<? extends InputType>,CompositeEvaluatorPair<InputType,IntermediateType,OutputType>>, Pair<BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>>,BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>>>
InputOutputTransformedBatchLearner
,
Serialized FormModifier and Type | Field and Description |
---|---|
protected BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> |
firstLearner
The first learner that is trained on the input data.
|
protected BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> |
secondLearner
The second learner that is trained on the output of the evaluator
created by the first learner.
|
Constructor and Description |
---|
CompositeBatchLearnerPair()
Creates a new, empty
CompositeBatchLearnerPair . |
CompositeBatchLearnerPair(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner,
BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner)
Creates a new
CompositeBatchLearnerPair with the given two
learner. |
Modifier and Type | Method and Description |
---|---|
static <InputType,IntermediateType,OutputType> |
create(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner,
BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner)
Creates a new
CompositeBatchLearnerPair from the given learners. |
static <InputType,IntermediateType,OutputType> |
createInputTransformed(Evaluator<? super InputType,? extends IntermediateType> inputTransform,
BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> learner)
Creates a new
CompositeBatchLearnerPair from the given input
transform and learner. |
static <InputType,IntermediateType,OutputType> |
createOutputTransformed(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> learner,
Evaluator<? super IntermediateType,? extends OutputType> outputTransform)
Creates a new
CompositeBatchLearnerPair from the given learner
and output transform.. |
BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> |
getFirst()
Gets the first object.
|
BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> |
getFirstLearner()
Gets the first learner that is applied to the input data.
|
BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> |
getSecond()
Gets the second object.
|
BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> |
getSecondLearner()
Gets the second learner that is applied to the output of the first
learner.
|
CompositeEvaluatorPair<InputType,IntermediateType,OutputType> |
learn(java.util.Collection<? extends InputType> data)
Learn by calling the first learner on all the input values.
|
void |
setFirstLearner(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner)
Sets the first learner that is applied to the input data.
|
void |
setSecondLearner(BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner)
Sets the second learner that is applied to the output of the first
learner.
|
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
clone
protected BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner
protected BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner
public CompositeBatchLearnerPair()
CompositeBatchLearnerPair
.public CompositeBatchLearnerPair(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner, BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner)
CompositeBatchLearnerPair
with the given two
learner.firstLearner
- The first learner that is trained on the input data.secondLearner
- The second learner that is trained based on the output of the first
learner.public CompositeEvaluatorPair<InputType,IntermediateType,OutputType> learn(java.util.Collection<? extends InputType> data)
learn
in interface BatchLearner<java.util.Collection<? extends InputType>,CompositeEvaluatorPair<InputType,IntermediateType,OutputType>>
data
- The training data.public BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> getFirst()
Pair
getFirst
in interface Pair<BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>>,BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>>>
public BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> getSecond()
Pair
getSecond
in interface Pair<BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>>,BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>>>
public BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> getFirstLearner()
public void setFirstLearner(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner)
firstLearner
- The first learner.public BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> getSecondLearner()
public void setSecondLearner(BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner)
secondLearner
- The second learner.public static <InputType,IntermediateType,OutputType> CompositeBatchLearnerPair<InputType,IntermediateType,OutputType> create(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> firstLearner, BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> secondLearner)
CompositeBatchLearnerPair
from the given learners.InputType
- The type of the input data. It is passed to the first learning
algorithm to learn the evaluator that takes this type and returns
the intermediate type.IntermediateType
- The type of the output of the first learned function that is used as
input to the second learner. It is also the input type for the second
learned evaluator that returns the output type.OutputType
- The type of output of the evaluator learned by the second learner.
It is also the output type of the composite evaluator pair.firstLearner
- The first learner that is trained on the input data.secondLearner
- The second learner that is trained based on the output of the first
learner.public static <InputType,IntermediateType,OutputType> CompositeBatchLearnerPair<InputType,IntermediateType,OutputType> createInputTransformed(Evaluator<? super InputType,? extends IntermediateType> inputTransform, BatchLearner<? super java.util.Collection<? extends IntermediateType>,? extends Evaluator<? super IntermediateType,? extends OutputType>> learner)
CompositeBatchLearnerPair
from the given input
transform and learner.InputType
- The type of the input data. It is passed to the input transform
takes this type and returns the intermediate type.IntermediateType
- The type of the output of the input transform is used as input to
the learner. It is also the input type for the learned evaluator
that returns the output type.OutputType
- The type of output of the learned evaluator. It is also the output
type of the composite evaluator pair.inputTransform
- The input transform to apply to the input data.learner
- The learner that is trained based on the output of the transform.public static <InputType,IntermediateType,OutputType> CompositeBatchLearnerPair<InputType,IntermediateType,OutputType> createOutputTransformed(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends IntermediateType>> learner, Evaluator<? super IntermediateType,? extends OutputType> outputTransform)
CompositeBatchLearnerPair
from the given learner
and output transform..InputType
- The type of the input data. It is passed to the learning algorithm
to learn the evaluator that takes this type and returns the
intermediate type.IntermediateType
- The type of the output of the first learned function that is used as
input to the output transform.OutputType
- The type of output of the output transform. It is also the output
type of the composite evaluator pair.learner
- The learner that is trained on the input data.outputTransform
- The output transform that is composed with the learned function.