public OneHotEncodingTransformer(ValueToKeyMappingEstimator term, IEstimator <ITransformer> toVector, IDataView input) { if (toVector != null) { _transformer = term.Append(toVector).Fit(input); } else { _transformer = new TransformerChain <ITransformer>(term.Fit(input)); } }
/// <summary> /// Returns the <see cref="SchemaShape"/> of the schema which will be produced by the transformer. /// Used for schema propagation and verification in a pipeline. /// </summary> public SchemaShape GetOutputSchema(SchemaShape inputSchema) { if (_toSomething != null) { return(_term.Append(_toSomething).GetOutputSchema(inputSchema)); } else { return(_term.GetOutputSchema(inputSchema)); } }
public SchemaShape GetOutputSchema(SchemaShape inputSchema) => _term.Append(_toSomething).GetOutputSchema(inputSchema);