/** * Creates a new KernelBasedIterativeRegression with the given kernel and * maximum number of iterations. * * @param kernel The kernel to use. * @param minSensitivity The minimum sensitivity to errors. * @param maxIterations The maximum number of iterations. */ public KernelBasedIterativeRegression( final Kernel<? super InputType> kernel, final double minSensitivity, final int maxIterations ) { super( maxIterations ); this.setKernel( kernel ); this.setMinSensitivity( minSensitivity ); this.setResult( null ); this.setErrorCount( 0 ); this.setSupportsMap( null ); }
/** * Creates a new KernelBasedIterativeRegression with the given kernel and * maximum number of iterations. * * @param kernel The kernel to use. * @param minSensitivity The minimum sensitivity to errors. * @param maxIterations The maximum number of iterations. */ public KernelBasedIterativeRegression( final Kernel<? super InputType> kernel, final double minSensitivity, final int maxIterations ) { super( maxIterations ); this.setKernel( kernel ); this.setMinSensitivity( minSensitivity ); this.setResult( null ); this.setErrorCount( 0 ); this.setSupportsMap( null ); }
/** * Creates a new KernelBasedIterativeRegression with the given kernel and * maximum number of iterations. * * @param kernel The kernel to use. * @param minSensitivity The minimum sensitivity to errors. * @param maxIterations The maximum number of iterations. */ public KernelBasedIterativeRegression( final Kernel<? super InputType> kernel, final double minSensitivity, final int maxIterations ) { super( maxIterations ); this.setKernel( kernel ); this.setMinSensitivity( minSensitivity ); this.setResult( null ); this.setErrorCount( 0 ); this.setSupportsMap( null ); }
protected boolean initializeAlgorithm() { if (this.getData() == null) { // Error: No data to learn on. return false; } // Count the number of valid examples. int validCount = 0; for (InputOutputPair<? extends InputType, Double> example : this.getData()) { if (example != null) { validCount++; } } if (validCount <= 0) { // Nothing to perform learning on. return false; } // Set up the learning variables. this.setErrorCount( validCount ); this.setSupportsMap( new LinkedHashMap<InputOutputPair<? extends InputType, Double>, DefaultWeightedValue<InputType>>() ); this.setResult( new KernelScalarFunction<InputType>( this.getKernel(), this.getSupportsMap().values(), 0.0 ) ); return true; }
protected boolean initializeAlgorithm() { if (this.getData() == null) { // Error: No data to learn on. return false; } // Count the number of valid examples. int validCount = 0; for (InputOutputPair<? extends InputType, Double> example : this.getData()) { if (example != null) { validCount++; } } if (validCount <= 0) { // Nothing to perform learning on. return false; } // Set up the learning variables. this.setErrorCount( validCount ); this.setSupportsMap( new LinkedHashMap<InputOutputPair<? extends InputType, Double>, DefaultWeightedValue<InputType>>() ); this.setResult( new KernelScalarFunction<InputType>( this.getKernel(), this.getSupportsMap().values(), 0.0 ) ); return true; }
protected boolean initializeAlgorithm() { if (this.getData() == null) { // Error: No data to learn on. return false; } // Count the number of valid examples. int validCount = 0; for (InputOutputPair<? extends InputType, Double> example : this.getData()) { if (example != null) { validCount++; } } if (validCount <= 0) { // Nothing to perform learning on. return false; } // Set up the learning variables. this.setErrorCount( validCount ); this.setSupportsMap( new LinkedHashMap<InputOutputPair<? extends InputType, Double>, DefaultWeightedValue<InputType>>() ); this.setResult( new KernelScalarFunction<InputType>( this.getKernel(), this.getSupportsMap().values(), 0.0 ) ); return true; }
@Override public KernelBasedIterativeRegression<InputType> clone() { KernelBasedIterativeRegression<InputType> clone = (KernelBasedIterativeRegression<InputType>) super.clone(); clone.setKernel( ObjectUtil.cloneSmart( this.getKernel() ) ); clone.setResult( ObjectUtil.cloneSafe( this.getResult() ) ); clone.setSupportsMap( ObjectUtil.cloneSmart( this.getSupportsMap() ) ); return clone; }
@Override public KernelBasedIterativeRegression<InputType> clone() { KernelBasedIterativeRegression<InputType> clone = (KernelBasedIterativeRegression<InputType>) super.clone(); clone.setKernel( ObjectUtil.cloneSmart( this.getKernel() ) ); clone.setResult( ObjectUtil.cloneSafe( this.getResult() ) ); clone.setSupportsMap( ObjectUtil.cloneSmart( this.getSupportsMap() ) ); return clone; }
@Override public KernelBasedIterativeRegression<InputType> clone() { KernelBasedIterativeRegression<InputType> clone = (KernelBasedIterativeRegression<InputType>) super.clone(); clone.setKernel( ObjectUtil.cloneSmart( this.getKernel() ) ); clone.setResult( ObjectUtil.cloneSafe( this.getResult() ) ); clone.setSupportsMap( ObjectUtil.cloneSmart( this.getSupportsMap() ) ); return clone; }