/** * Select the method to create. * * @param dataset The dataset. * @param methodType The method type. */ public void selectMethod(VersatileMLDataSet dataset, String methodType) { if (!this.methodConfigurations.containsKey(methodType)) { throw new EncogError("Don't know how to autoconfig method: " + methodType); } this.config = this.methodConfigurations.get(methodType); this.methodType = methodType; this.methodArgs = this.config.suggestModelArchitecture(dataset); dataset .getNormHelper() .setStrategy(this.config.suggestNormalizationStrategy(dataset, methodArgs)); }
/** * Create the selected method. * * @return The created method. */ public MLMethod createMethod() { if (this.methodType == null) { throw new EncogError( "Please call selectMethod first to choose what type of method you wish to use."); } MLMethodFactory methodFactory = new MLMethodFactory(); MLMethod method = methodFactory.create( methodType, methodArgs, dataset.getNormHelper().calculateNormalizedInputCount(), this.config.determineOutputCount(dataset)); return method; }