コード例 #1
0
ファイル: XGBooster.cs プロジェクト: jcapellman/XGBoost.Net
        public byte[] GetModelRaw()
        {
            int    length;
            IntPtr dumpPtr;
            int    output = XGBoostNative.XGBoosterGetModelRaw(handle, out length, out dumpPtr);

            if (output == -1)
            {
                throw new DllFailException(XGBoostNative.XGBGetLastError());
            }
            byte[] modelBytes = new byte[length];
            Marshal.Copy(dumpPtr, modelBytes, 0, length);
            return(modelBytes);
        }