void _CreateMapper(IDataScorerTransform scorer) { _mapperBinaryClassification = null; var schema = scorer.Schema; int i1, i2, i3; i1 = SchemaHelper.GetColumnIndex(schema, "PredictedLabel"); i2 = SchemaHelper.GetColumnIndex(schema, "Score"); i3 = SchemaHelper.GetColumnIndex(schema, "Probability"); var map = new ValueMapperFromTransform <TRowValue, PredictionTypeForBinaryClassification>(_env, scorer); _mapperBinaryClassification = map.GetMapper <TRowValue, PredictionTypeForBinaryClassification>(); _valueMapper = map; }
void _CreateMapper(IDataScorerTransform scorer, int conc) { _mapperBinaryClassification = null; var schema = scorer.Schema; int i1, i2, i3; if (schema.TryGetColumnIndex("PredictedLabel", out i1) && schema.TryGetColumnIndex("Score", out i2) && schema.TryGetColumnIndex("Probability", out i3)) { var map = new ValueMapperFromTransform <TRowValue, PredictionTypeForBinaryClassification>(_env, scorer, conc: conc); _mapperBinaryClassification = map.GetMapper <TRowValue, PredictionTypeForBinaryClassification>(); _valueMapper = map; } else { throw Contracts.Except($"Unable to guess the prediction task from schema '{SchemaHelper.ToString(schema)}'."); } }