/** * Create an instance of {@link LocalTransformations } * */ public LocalTransformations createLocalTransformations() { return new LocalTransformations(); }
/** * Create an instance of {@link LocalTransformations } * */ public LocalTransformations createLocalTransformations() { return new LocalTransformations(); }
private LocalTransformations getLocalTranformations(NeuralNetwork model) { // delete target List<DerivedField> derivedFields = model.getLocalTransformations().getDerivedFields(); // add bias DerivedField field = new DerivedField(OpType.CONTINUOUS, DataType.DOUBLE).withName(new FieldName( PluginConstants.biasValue)); field.withExpression(new Constant(String.valueOf(PluginConstants.bias))); derivedFields.add(field); return new LocalTransformations().withDerivedFields(derivedFields); }
@Override public LocalTransformations build(BasicML basicML) { LocalTransformations localTransformations = new LocalTransformations(); if(basicML instanceof BasicFloatNetwork) { BasicFloatNetwork bfn = (BasicFloatNetwork) basicML; Set<Integer> featureSet = bfn.getFeatureSet(); for(ColumnConfig config: columnConfigList) { if(config.isFinalSelect() && (CollectionUtils.isEmpty(featureSet) || featureSet.contains(config.getColumnNum()))) { double cutoff = modelConfig.getNormalizeStdDevCutOff(); localTransformations.withDerivedFields(config.isCategorical() ? createCategoricalDerivedField( config, cutoff, modelConfig.getNormalizeType()) : createNumericalDerivedField(config, cutoff, modelConfig.getNormalizeType())); } } } else { for(ColumnConfig config: columnConfigList) { if(config.isFinalSelect()) { double cutoff = modelConfig.getNormalizeStdDevCutOff(); localTransformations.withDerivedFields(config.isCategorical() ? createCategoricalDerivedField( config, cutoff, modelConfig.getNormalizeType()) : createNumericalDerivedField(config, cutoff, modelConfig.getNormalizeType())); } } } return localTransformations; }