/** * Gets the input value of the given training example index. * * @param i * The training example index. Must be between 0 and dataSize - 1. * @return * The input value for that index. */ private InputType getPoint( final int i) { return this.dataList.get(i).getInput(); }
/** * Gets the input value of the given training example index. * * @param i * The training example index. Must be between 0 and dataSize - 1. * @return * The input value for that index. */ private InputType getPoint( final int i) { return this.dataList.get(i).getInput(); }
/** * Gets the input value of the given training example index. * * @param i * The training example index. Must be between 0 and dataSize - 1. * @return * The input value for that index. */ private InputType getPoint( final int i) { return this.dataList.get(i).getInput(); }
/** * Evaluates the Inverse Student-t CDF for the given probability * and degrees of freedom * @param p * Value at which to solve for x such that x=CDF(p) * @return * Value of x such that x=CDF(p) */ @Override public Double inverse( final double p ) { return InverseTransformSampling.inverse( this, p ).getInput(); }
@Override public void update( final ResultType target, final InputOutputPair<? extends InputType, OutputType> data) { // Unpack the pair. this.update(target, data.getInput(), data.getOutput()); }
@Override public void update( final ResultType target, final InputOutputPair<? extends InputType, OutputType> data) { // Unpack the pair. this.update(target, data.getInput(), data.getOutput()); }
@Override public void update( final ResultType target, final InputOutputPair<? extends InputType, OutputType> data) { // Unpack the pair. this.update(target, data.getInput(), data.getOutput()); }
@Override public <InputType> void update( final DefaultKernelBinaryCategorizer<InputType> target, final InputType input, final Boolean output) { this.update(target, input, (boolean) output); }
@Override public DiscreteNaiveBayesCategorizer<InputType, CategoryType> learn( final Collection<? extends InputOutputPair<? extends Collection<InputType>, CategoryType>> data) { DiscreteNaiveBayesCategorizer<InputType,CategoryType> nbc = new DiscreteNaiveBayesCategorizer<InputType, CategoryType>(); for( InputOutputPair<? extends Collection<InputType>,CategoryType> sample : data ) { nbc.update(sample.getInput(), sample.getOutput()); } return nbc; }
@Override public DiscreteNaiveBayesCategorizer<InputType, CategoryType> learn( final Collection<? extends InputOutputPair<? extends Collection<InputType>, CategoryType>> data) { DiscreteNaiveBayesCategorizer<InputType,CategoryType> nbc = new DiscreteNaiveBayesCategorizer<InputType, CategoryType>(); for( InputOutputPair<? extends Collection<InputType>,CategoryType> sample : data ) { nbc.update(sample.getInput(), sample.getOutput()); } return nbc; }
@Override public DiscreteNaiveBayesCategorizer<InputType, CategoryType> learn( final Collection<? extends InputOutputPair<? extends Collection<InputType>, CategoryType>> data) { DiscreteNaiveBayesCategorizer<InputType,CategoryType> nbc = new DiscreteNaiveBayesCategorizer<InputType, CategoryType>(); for( InputOutputPair<? extends Collection<InputType>,CategoryType> sample : data ) { nbc.update(sample.getInput(), sample.getOutput()); } return nbc; }
@Override public <InputType> void update( final DefaultKernelBinaryCategorizer<InputType> target, final InputType input, final Boolean output) { this.update(target, input, (boolean) output); }
@Override public <InputType> void update( final DefaultKernelBinaryCategorizer<InputType> target, final InputType input, final Boolean output) { this.update(target, input, (boolean) output); }
public InputOutputPair<Double, Double> getResult() { if( (this.internalFunction == null) || (this.getAlgorithm().getResult() == null) ) { return null; } else { Double x = this.getAlgorithm().getResult().getInput(); return new DefaultInputOutputPair<Double, Double>( x, this.internalFunction.function.evaluate(x) ); } }
@SuppressWarnings("unchecked") public ResultType learn( Collection<? extends InputOutputPair<? extends Vector, Vector>> data ) { this.getCostFunction().setCostParameters( data ); this.setResult( (ResultType) this.getObjectToOptimize().clone() ); Vector parameters = this.getResult().convertToVector(); this.getAlgorithm().setInitialGuess( parameters ); EvaluatorType internalFunction = this.createInternalFunction(); InputOutputPair<Vector,Double> bestParameters = this.getAlgorithm().learn( internalFunction ); this.getResult().convertFromVector( bestParameters.getInput() ); return this.getResult(); }
@SuppressWarnings("unchecked") public ResultType learn( Collection<? extends InputOutputPair<? extends Vector, Vector>> data ) { this.getCostFunction().setCostParameters( data ); this.setResult( (ResultType) this.getObjectToOptimize().clone() ); Vector parameters = this.getResult().convertToVector(); this.getAlgorithm().setInitialGuess( parameters ); EvaluatorType internalFunction = this.createInternalFunction(); InputOutputPair<Vector,Double> bestParameters = this.getAlgorithm().learn( internalFunction ); this.getResult().convertFromVector( bestParameters.getInput() ); return this.getResult(); }
@SuppressWarnings("unchecked") public ResultType learn( Collection<? extends InputOutputPair<? extends Vector, Vector>> data ) { this.getCostFunction().setCostParameters( data ); this.setResult( (ResultType) this.getObjectToOptimize().clone() ); Vector parameters = this.getResult().convertToVector(); this.getAlgorithm().setInitialGuess( parameters ); EvaluatorType internalFunction = this.createInternalFunction(); InputOutputPair<Vector,Double> bestParameters = this.getAlgorithm().learn( internalFunction ); this.getResult().convertFromVector( bestParameters.getInput() ); return this.getResult(); }