예제 #1
0
        public unsafe double [] PredictForMat(PredictType predictType, float [] data, int numIteration = -1)
        {
            if (predictType == PredictType.LeafIndex)
            {
                throw new NotImplementedException("TODO: PredictType.LeafIndex");
            }

            long outLen = NumClasses; // TODO

            double[] outResult = new double[outLen];

            fixed(double *ptr = outResult)
            PInvokeException.Check(PInvoke.BoosterPredictForMat(Handle
                                                                , data
                                                                , /*nRow*/ 1
                                                                , /*nCol*/ data.Length
                                                                , /*isRowMajor*/ true
                                                                , (PInvoke.CApiPredictType)predictType
                                                                , (numIteration == -1) ? BestIteration : numIteration
                                                                , ""
                                                                , ref outLen
                                                                , ptr
                                                                ), nameof(PInvoke.BoosterPredictForMat));

            return(outResult);
        }