InputType
- The input type of the data to learn on. This is passed into the
unsupervised learner for the input transform to create the evaluator
that will then produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of the output transformer (and input type of its
reverse).OutputType
- The output type of the data to learn on. This is passed into the
unsupervised learner for the output transform to create the reversible
data converter for mapping the OutputType
to the
TransformedOutputType
, or vice-versa.public class InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> extends AbstractBatchLearnerContainer<BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>>> implements SupervisedBatchLearner<InputType,OutputType,CompositeEvaluatorTriple<InputType,TransformedInputType,TransformedOutputType,OutputType>>
create
methods, or by
passing in ConstantLearner
s that contain
IdentityEvaluator
s. Thus, this class can act as a very flexible
adapter for many types of supervised learning problems.Modifier and Type | Field and Description |
---|---|
protected BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> |
inputLearner
The unsupervised learning algorithm for creating the input
transformation.
|
protected BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> |
outputLearner
The unsupervised learning algorithm for creating the output
transformation, which must be reversible for evaluation.
|
learner
Constructor and Description |
---|
InputOutputTransformedBatchLearner()
Creates a new, empty
InputOutputTransformedBatchLearner . |
InputOutputTransformedBatchLearner(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner,
BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
Creates a new
InputOutputTransformedBatchLearner with the given
learners. |
Modifier and Type | Method and Description |
---|---|
InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> |
clone()
This makes public the clone method on the
Object class and
removes the exception that it throws. |
static <InputType,TransformedInputType,TransformedOutputType,OutputType> |
create(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner,
BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
Creates a new
InputOutputTransformedBatchLearner from the
three learners. |
static <InputType,TransformedInputType,TransformedOutputType,OutputType> |
create(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner,
ReversibleEvaluator<OutputType,TransformedOutputType,?> outputTransform)
Creates a new
InputOutputTransformedBatchLearner from the
unsupervised input transform learner, supervised learners, and output
transform. |
static <InputType,TransformedInputType,TransformedOutputType,OutputType> |
create(Evaluator<? super InputType,? extends TransformedInputType> inputTransform,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner,
BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
Creates a new
InputOutputTransformedBatchLearner from the
input transform, supervised learner, and unsupervised output transform
learner. |
static <InputType,TransformedInputType,TransformedOutputType,OutputType> |
create(Evaluator<? super InputType,? extends TransformedInputType> inputTransform,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner,
ReversibleEvaluator<OutputType,TransformedOutputType,?> outputTransform)
Creates a new
InputOutputTransformedBatchLearner from the
predefined input and output transforms and the supervised learner. |
static <InputType,TransformedInputType,OutputType> |
createInputTransformed(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,OutputType>>,? extends Evaluator<? super TransformedInputType,? extends OutputType>> learner)
Creates a new
InputOutputTransformedBatchLearner from the
input and supervised learners, performing no transformation on the
output type. |
static <InputType,TransformedInputType,OutputType> |
createInputTransformed(Evaluator<? super InputType,? extends TransformedInputType> inputTransform,
BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,OutputType>>,? extends Evaluator<? super TransformedInputType,? extends OutputType>> learner)
Creates a new
InputOutputTransformedBatchLearner from the
predefined input transform and the supervised learner. |
static <InputType,TransformedOutputType,OutputType> |
createOutputTransformed(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,TransformedOutputType>>,? extends Evaluator<? super InputType,? extends TransformedOutputType>> learner,
BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
Creates a new
InputOutputTransformedBatchLearner from the
supervised and output learners, performing no transformation on the
input type. |
static <InputType,TransformedOutputType,OutputType> |
createOutputTransformed(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,TransformedOutputType>>,? extends Evaluator<? super InputType,? extends TransformedOutputType>> learner,
ReversibleEvaluator<OutputType,TransformedOutputType,?> outputTransform)
Creates a new
InputOutputTransformedBatchLearner from the
predefined output transforms and the supervised learner. |
BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> |
getInputLearner()
Gets the unsupervised learning algorithm for creating the input
transformation.
|
BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> |
getOutputLearner()
Gets the unsupervised learning algorithm for creating the
output transformation, which must be reversible for evaluation.
|
CompositeEvaluatorTriple<InputType,TransformedInputType,TransformedOutputType,OutputType> |
learn(java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
Learn by first calling the input transformation learner on all the
input values and the output transformation on the output values.
|
void |
setInputLearner(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner)
Sets the unsupervised learning algorithm for creating the input
transformation.
|
void |
setOutputLearner(BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
Gets the unsupervised learning algorithm for creating the
output transformation, which must be reversible for evaluation.
|
getLearner, setLearner
protected BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner
protected BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner
public InputOutputTransformedBatchLearner()
InputOutputTransformedBatchLearner
.public InputOutputTransformedBatchLearner(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner, BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
InputOutputTransformedBatchLearner
with the given
learners.inputLearner
- The unsupervised learning algorithm for creating the input
transformation.learner
- The supervised learner whose input and output are being
adapted.outputLearner
- The unsupervised learning algorithm for creating the
output transformation, which must be reversible for evaluation.public InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> clone()
AbstractCloneableSerializable
Object
class and
removes the exception that it throws. Its default behavior is to
automatically create a clone of the exact type of object that the
clone is called on and to copy all primitives but to keep all references,
which means it is a shallow copy.
Extensions of this class may want to override this method (but call
super.clone()
to implement a "smart copy". That is, to target
the most common use case for creating a copy of the object. Because of
the default behavior being a shallow copy, extending classes only need
to handle fields that need to have a deeper copy (or those that need to
be reset). Some of the methods in ObjectUtil
may be helpful in
implementing a custom clone method.
Note: The contract of this method is that you must use
super.clone()
as the basis for your implementation.clone
in interface CloneableSerializable
clone
in class AbstractBatchLearnerContainer<BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>>>
public CompositeEvaluatorTriple<InputType,TransformedInputType,TransformedOutputType,OutputType> learn(java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>> data)
learn
in interface BatchLearner<java.util.Collection<? extends InputOutputPair<? extends InputType,OutputType>>,CompositeEvaluatorTriple<InputType,TransformedInputType,TransformedOutputType,OutputType>>
data
- The training data.public BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> getInputLearner()
public void setInputLearner(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner)
inputLearner
- The input transformation learner.public BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> getOutputLearner()
public void setOutputLearner(BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
outputLearner
- The output transformation learner.public static <InputType,TransformedInputType,TransformedOutputType,OutputType> InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> create(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner, BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
InputOutputTransformedBatchLearner
from the
three learners.InputType
- The input type of the data to learn on. This is passed into the
unsupervised learner for the input transform to create the evaluator
that will then produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of the output transformer.OutputType
- The output type of the data to learn on. This is passed into the
unsupervised learner for the output transform to create the reversible
data converter for mapping the OutputType
to the
TransformedOutputType
to the, or vice-versa.inputLearner
- The unsupervised learning algorithm for creating the input
transformation.learner
- The supervised learner whose input and output are being
adapted.outputLearner
- The unsupervised learning algorithm for creating the output
transformation, which must be reversible for evaluation.public static <InputType,TransformedInputType,OutputType> InputOutputTransformedBatchLearner<InputType,TransformedInputType,OutputType,OutputType> createInputTransformed(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,OutputType>>,? extends Evaluator<? super TransformedInputType,? extends OutputType>> learner)
InputOutputTransformedBatchLearner
from the
input and supervised learners, performing no transformation on the
output type.InputType
- The input type of the data to learn on. This is passed into the
unsupervised learner for the input transform to create the evaluator
that will then produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.OutputType
- The output type of the data to learn on. It will be used as the
output values to train the (middle) supervised learner.inputLearner
- The unsupervised learning algorithm for creating the input
transformation.learner
- The supervised learner whose input is being adapted.public static <InputType,TransformedOutputType,OutputType> InputOutputTransformedBatchLearner<InputType,InputType,TransformedOutputType,OutputType> createOutputTransformed(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,TransformedOutputType>>,? extends Evaluator<? super InputType,? extends TransformedOutputType>> learner, BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
InputOutputTransformedBatchLearner
from the
supervised and output learners, performing no transformation on the
input type.InputType
- The input type of the data to learn on. It will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of of the output transformer.OutputType
- The output type of the data to learn on. This is passed into the
unsupervised learner for the output transform to create the reversible
data converter for mapping the OutputType
to the
TransformedOutputType
to the, or vice-versa.learner
- The supervised learner whose output is being adapted.outputLearner
- The unsupervised learning algorithm for creating the output
transformation, which must be reversible for evaluation.public static <InputType,TransformedInputType,TransformedOutputType,OutputType> InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> create(Evaluator<? super InputType,? extends TransformedInputType> inputTransform, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner, ReversibleEvaluator<OutputType,TransformedOutputType,?> outputTransform)
InputOutputTransformedBatchLearner
from the
predefined input and output transforms and the supervised learner.InputType
- The input type of the data to learn on. This is passed into the
input transform to produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of the output transformer.OutputType
- The output type of the data to learn on. This is passed into the
reversible output data converter for mapping the OutputType
to the TransformedOutputType
to the, or vice-versa.inputTransform
- The predefined input transformation.learner
- The supervised learner whose input and output are being
adapted.outputTransform
- The predefined output transformation.public static <InputType,TransformedInputType,OutputType> InputOutputTransformedBatchLearner<InputType,TransformedInputType,OutputType,OutputType> createInputTransformed(Evaluator<? super InputType,? extends TransformedInputType> inputTransform, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,OutputType>>,? extends Evaluator<? super TransformedInputType,? extends OutputType>> learner)
InputOutputTransformedBatchLearner
from the
predefined input transform and the supervised learner. It uses no
output transformation.InputType
- The input type of the data to learn on. This is passed into the
input transform to produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.OutputType
- The output type of the data to learn on. It will be used as the
output values to train the (middle) supervised learner.inputTransform
- The predefined input transformation.learner
- The supervised learner whose input and output are being
adapted.public static <InputType,TransformedOutputType,OutputType> InputOutputTransformedBatchLearner<InputType,InputType,TransformedOutputType,OutputType> createOutputTransformed(BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends InputType,TransformedOutputType>>,? extends Evaluator<? super InputType,? extends TransformedOutputType>> learner, ReversibleEvaluator<OutputType,TransformedOutputType,?> outputTransform)
InputOutputTransformedBatchLearner
from the
predefined output transforms and the supervised learner. It uses no
input transformation.InputType
- The input type of the data to learn on. It will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of of the output transformer.OutputType
- The output type of the data to learn on. This is passed into the
reversible output data converter for mapping the OutputType
to the TransformedOutputType
to the, or vice-versa.learner
- The supervised learner whose input and output are being
adapted.outputTransform
- The predefined output transformation.public static <InputType,TransformedInputType,TransformedOutputType,OutputType> InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> create(BatchLearner<? super java.util.Collection<? extends InputType>,? extends Evaluator<? super InputType,? extends TransformedInputType>> inputLearner, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner, ReversibleEvaluator<OutputType,TransformedOutputType,?> outputTransform)
InputOutputTransformedBatchLearner
from the
unsupervised input transform learner, supervised learners, and output
transform.InputType
- The input type of the data to learn on. This is passed into the
unsupervised learner for the input transform to create the evaluator
that will then produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of the output transformer.OutputType
- The output type of the data to learn on. This is passed into the
reversible output data converter for mapping the OutputType
to the TransformedOutputType
to the, or vice-versa.inputLearner
- The unsupervised learning algorithm for creating the input
transformation.learner
- The supervised learner whose input and output are being
adapted.outputTransform
- The predefined output transformation.public static <InputType,TransformedInputType,TransformedOutputType,OutputType> InputOutputTransformedBatchLearner<InputType,TransformedInputType,TransformedOutputType,OutputType> create(Evaluator<? super InputType,? extends TransformedInputType> inputTransform, BatchLearner<? super java.util.Collection<? extends InputOutputPair<? extends TransformedInputType,TransformedOutputType>>,? extends Evaluator<? super TransformedInputType,? extends TransformedOutputType>> learner, BatchLearner<? super java.util.Collection<? extends OutputType>,? extends ReversibleEvaluator<OutputType,TransformedOutputType,?>> outputLearner)
InputOutputTransformedBatchLearner
from the
input transform, supervised learner, and unsupervised output transform
learner.InputType
- The input type of the data to learn on. This is passed into the
input transform to produce the TransformedInputType
.TransformedInputType
- The output type of the input transformer, which will be used as the
input values to train the (middle) supervised learner.TransformedOutputType
- The input type of the output transformer, which will be used as the
output values to train the (middle) supervised learner. It will be
the output type of of the output transformer.OutputType
- The output type of the data to learn on. This is passed into the
unsupervised learner for the output transform to create the reversible
data converter for mapping the OutputType
to the
TransformedOutputType
to the, or vice-versa.inputTransform
- The predefined input transformation.learner
- The supervised learner whose input and output are being
adapted.outputLearner
- The unsupervised learning algorithm for creating the output
transformation, which must be reversible for evaluation.