コード例 #1
0
ファイル: XGBooster.cs プロジェクト: jcapellman/XGBoost.Net
        public float[] Predict(DMatrix test, bool predContribs = false, int ntreeLimit = 0)
        {
            ulong  predsLen;
            IntPtr predsPtr;
            int    optionsMask = predContribs ? ContribsOptionMask : NormalOptionMask;
            var    output      = XGBoostNative.XGBoosterPredict(
                handle, test.Handle, optionsMask, ntreeLimit, out predsLen, out predsPtr);

            if (output == -1)
            {
                throw new DllFailException(XGBoostNative.XGBGetLastError());
            }
            return(GetPredictionsArray(predsPtr, predsLen));
        }