/** * Convenience method to create a new, empty * {@code DefaultWeightedInputOutputPair}. * * @param <InputType> * The type for the input object in the pair. * @param <OutputType> * The type for the output object in the pair. * @return * A new, empty {@code DefaultWeightedInputOutputPair}. */ public static <InputType, OutputType> DefaultWeightedInputOutputPair<InputType, OutputType> create() { return new DefaultWeightedInputOutputPair<InputType, OutputType>(); }
/** * Convenience method to create a new, empty * {@code DefaultWeightedInputOutputPair}. * * @param <InputType> * The type for the input object in the pair. * @param <OutputType> * The type for the output object in the pair. * @return * A new, empty {@code DefaultWeightedInputOutputPair}. */ public static <InputType, OutputType> DefaultWeightedInputOutputPair<InputType, OutputType> create() { return new DefaultWeightedInputOutputPair<InputType, OutputType>(); }
/** * Convenience method to create a new, empty * {@code DefaultWeightedInputOutputPair}. * * @param <InputType> * The type for the input object in the pair. * @param <OutputType> * The type for the output object in the pair. * @return * A new, empty {@code DefaultWeightedInputOutputPair}. */ public static <InputType, OutputType> DefaultWeightedInputOutputPair<InputType, OutputType> create() { return new DefaultWeightedInputOutputPair<InputType, OutputType>(); }
/** * Convenience method to create a new * {@code DefaultWeightedInputOutputPair}. * * @param <InputType> * The type for the input object in the pair. * @param <OutputType> * The type for the output object in the pair. * @param input * The input. * @param output * The output. * @param weight * The weight. * @return * A new default weighted input-output pair with the given input, * output, and weight. */ public static <InputType, OutputType> DefaultWeightedInputOutputPair<InputType, OutputType> create( final InputType input, final OutputType output, final double weight) { return new DefaultWeightedInputOutputPair<InputType, OutputType>(input, output, weight); }
/** * Convenience method to create a new * {@code DefaultWeightedInputOutputPair}. * * @param <InputType> * The type for the input object in the pair. * @param <OutputType> * The type for the output object in the pair. * @param input * The input. * @param output * The output. * @param weight * The weight. * @return * A new default weighted input-output pair with the given input, * output, and weight. */ public static <InputType, OutputType> DefaultWeightedInputOutputPair<InputType, OutputType> create( final InputType input, final OutputType output, final double weight) { return new DefaultWeightedInputOutputPair<InputType, OutputType>(input, output, weight); }
/** * Convenience method to create a new * {@code DefaultWeightedInputOutputPair}. * * @param <InputType> * The type for the input object in the pair. * @param <OutputType> * The type for the output object in the pair. * @param input * The input. * @param output * The output. * @param weight * The weight. * @return * A new default weighted input-output pair with the given input, * output, and weight. */ public static <InputType, OutputType> DefaultWeightedInputOutputPair<InputType, OutputType> create( final InputType input, final OutputType output, final double weight) { return new DefaultWeightedInputOutputPair<InputType, OutputType>(input, output, weight); }
protected boolean initializeAlgorithm() { this.weightedData = new ArrayList<DefaultWeightedInputOutputPair<InputType, OutputType>>( this.data.size() ); for (InputOutputPair<? extends InputType, ? extends OutputType> pair : this.data) { // Create an initial weighted dataset, using the weights from // the original dataset, if available, otherwise just use // uniform weights double weight = DatasetUtil.getWeight(pair); this.weightedData.add( new DefaultWeightedInputOutputPair<InputType, OutputType>( pair.getInput(), pair.getOutput(), weight ) ); } return true; }
protected boolean initializeAlgorithm() { this.weightedData = new ArrayList<DefaultWeightedInputOutputPair<InputType, OutputType>>( this.data.size() ); for (InputOutputPair<? extends InputType, ? extends OutputType> pair : this.data) { // Create an initial weighted dataset, using the weights from // the original dataset, if available, otherwise just use // uniform weights double weight = DatasetUtil.getWeight(pair); this.weightedData.add( new DefaultWeightedInputOutputPair<InputType, OutputType>( pair.getInput(), pair.getOutput(), weight ) ); } return true; }
protected boolean initializeAlgorithm() { this.weightedData = new ArrayList<DefaultWeightedInputOutputPair<InputType, OutputType>>( this.data.size() ); for (InputOutputPair<? extends InputType, ? extends OutputType> pair : this.data) { // Create an initial weighted dataset, using the weights from // the original dataset, if available, otherwise just use // uniform weights double weight = DatasetUtil.getWeight(pair); this.weightedData.add( new DefaultWeightedInputOutputPair<InputType, OutputType>( pair.getInput(), pair.getOutput(), weight ) ); } return true; }
/** * {@inheritDoc} * @param cogxels {@inheritDoc} * @return {@inheritDoc} */ public WeightedInputOutputPair<InputType, OutputType> fromCogxels( CogxelState cogxels) { InputOutputPair<InputType,OutputType> pair = this.getPairConverter().fromCogxels( cogxels ); double weight = this.getWeightConverter().fromCogxels( cogxels ); return new DefaultWeightedInputOutputPair<InputType,OutputType>( pair, weight ); }
/** * {@inheritDoc} * @param cogxels {@inheritDoc} * @return {@inheritDoc} */ public WeightedInputOutputPair<InputType, OutputType> fromCogxels( CogxelState cogxels) { InputOutputPair<InputType,OutputType> pair = this.getPairConverter().fromCogxels( cogxels ); double weight = this.getWeightConverter().fromCogxels( cogxels ); return new DefaultWeightedInputOutputPair<InputType,OutputType>( pair, weight ); }
new DefaultWeightedInputOutputPair<InputType, Boolean>( example, 1.0)); numExamples++;
VectorFactory.getDefault().copyValues(output); final double weight = DatasetUtil.getWeight(example); vectorData.add(new DefaultWeightedInputOutputPair<InputType, Vector>( input, outputVector, weight));
VectorFactory.getDefault().copyValues(output); final double weight = DatasetUtil.getWeight(example); vectorData.add(new DefaultWeightedInputOutputPair<InputType, Vector>( input, outputVector, weight));
VectorFactory.getDefault().copyValues(output); final double weight = DatasetUtil.getWeight(example); vectorData.add(new DefaultWeightedInputOutputPair<InputType, Vector>( input, outputVector, weight));
new DefaultWeightedInputOutputPair<InputType, CategoryType>( example.getInput(), example.getOutput(), DatasetUtil.getWeight(example)));
new DefaultWeightedInputOutputPair<InputType, CategoryType>( example.getInput(), example.getOutput(), DatasetUtil.getWeight(example)));
Vector vectorInput = function.computeVector( scale ); return new DefaultWeightedInputOutputPair<Vector, Double>( vectorInput, lineMinimum.getOutput(), scale );
Vector vectorInput = function.computeVector( scale ); return new DefaultWeightedInputOutputPair<Vector, Double>( vectorInput, lineMinimum.getOutput(), scale );
Vector vectorInput = function.computeVector( scale ); return new DefaultWeightedInputOutputPair<Vector, Double>( vectorInput, lineMinimum.getOutput(), scale );