public FieldAwareFactorizationMachinePredictionTransformer(IHostEnvironment host, FieldAwareFactorizationMachinePredictor model, ISchema trainSchema, string[] featureColumns, float threshold = 0f, string thresholdColumn = DefaultColumnNames.Score) : base(Contracts.CheckRef(host, nameof(host)).Register(nameof(FieldAwareFactorizationMachinePredictionTransformer)), model, trainSchema) { Host.CheckNonEmpty(thresholdColumn, nameof(thresholdColumn)); _threshold = threshold; _thresholdColumn = thresholdColumn; Host.CheckValue(featureColumns, nameof(featureColumns)); int featCount = featureColumns.Length; Host.Check(featCount >= 0, "Empty features column."); FeatureColumns = featureColumns; FeatureColumnTypes = new ColumnType[featCount]; int i = 0; foreach (var feat in featureColumns) { if (!trainSchema.TryGetColumnIndex(feat, out int col)) { throw Host.ExceptSchemaMismatch(nameof(featureColumns), RoleMappedSchema.ColumnRole.Feature.Value, feat); } FeatureColumnTypes[i++] = trainSchema.GetColumnType(col); } BindableMapper = ScoreUtils.GetSchemaBindableMapper(Host, model); var schema = GetSchema(); var args = new BinaryClassifierScorer.Arguments { Threshold = _threshold, ThresholdColumn = _thresholdColumn }; _scorer = new BinaryClassifierScorer(Host, args, new EmptyDataView(Host, trainSchema), BindableMapper.Bind(Host, schema), schema); }