protected TVectorPredictor CreateFinalPredictor(IChannel ch, RoleMappedData data,
                                                        MultiToBinaryTransform trans, int count, Arguments args,
                                                        TScalarPredictor[] predictors, IPredictor reclassPredictor)
        {
            // We create the final predictor. We remove every unneeded transform.
            string dstName, labName;
            var    trans_ = trans;

            trans = MapLabelsAndInsertTransform(ch, data, out dstName, out labName, count, false, args);
            trans.Steal(trans_);

            int indexLab;

            if (!trans.Schema.TryGetColumnIndex(labName, out indexLab))
            {
                throw ch.Except("Unable to find column '{0}' in \n{1}", labName, SchemaHelper.ToString(trans.Schema));
            }

            var labType        = trans.Schema.GetColumnType(indexLab);
            var initialLabKind = data.Schema.Label.Type.RawKind();

            TVectorPredictor predictor;

            switch (initialLabKind)
            {
            case DataKind.R4:
                var p4 = MultiToBinaryPredictor.Create(Host, trans.GetClasses <float>(), predictors, reclassPredictor, args.singleColumn, false);
                predictor = p4 as TVectorPredictor;
                break;

            case DataKind.U1:
                var pu1 = MultiToBinaryPredictor.Create(Host, trans.GetClasses <byte>(), predictors, reclassPredictor, args.singleColumn, true);
                predictor = pu1 as TVectorPredictor;
                break;

            case DataKind.U2:
                var pu2 = MultiToBinaryPredictor.Create(Host, trans.GetClasses <ushort>(), predictors, reclassPredictor, args.singleColumn, true);
                predictor = pu2 as TVectorPredictor;
                break;

            case DataKind.U4:
                var pu4 = MultiToBinaryPredictor.Create(Host, trans.GetClasses <uint>(), predictors, reclassPredictor, args.singleColumn, true);
                predictor = pu4 as TVectorPredictor;
                break;

            default:
                throw ch.ExceptNotSupp("Unsupported type for a multi class label.");
            }

            Host.Assert(predictor != null);
            return(predictor);
        }
        protected TVectorPredictor CreateFinalPredictor(IChannel ch, RoleMappedData data,
                                                        MultiToBinaryTransform trans, int count, Arguments args,
                                                        TScalarPredictor[] predictors, IPredictor reclassPredictor)
        {
            // We create the final predictor. We remove every unneeded transform.
            string dstName, labName;
            int    indexLab;
            var    trans_ = trans;

            trans = MapLabelsAndInsertTransform(ch, data, out dstName, out labName, count, false, _args);
            trans.Steal(trans_);
            indexLab = SchemaHelper.GetColumnIndex(trans.Schema, labName);
            var labType        = trans.Schema[indexLab].Type;
            var initialLabKind = data.Schema.Label.Value.Type.RawKind();

            TVectorPredictor predictor;

            switch (initialLabKind)
            {
            case DataKind.Single:
                var p4 = MultiToRankerPredictor.Create(Host, trans.GetClasses <float>(), predictors, _reclassPredictor, _args.singleColumn, false);
                predictor = p4 as TVectorPredictor;
                break;

            case DataKind.SByte:
                var pu1 = MultiToRankerPredictor.Create(Host, trans.GetClasses <byte>(), predictors, _reclassPredictor, _args.singleColumn, true);
                predictor = pu1 as TVectorPredictor;
                break;

            case DataKind.UInt16:
                var pu2 = MultiToRankerPredictor.Create(Host, trans.GetClasses <ushort>(), predictors, _reclassPredictor, _args.singleColumn, true);
                predictor = pu2 as TVectorPredictor;
                break;

            case DataKind.UInt32:
                var pu4 = MultiToRankerPredictor.Create(Host, trans.GetClasses <uint>(), predictors, _reclassPredictor, _args.singleColumn, true);
                predictor = pu4 as TVectorPredictor;
                break;

            default:
                throw ch.ExceptNotSupp("Unsupported type for a multi class label.");
            }

            Host.Assert(predictor != null);
            return(predictor);
        }