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; }