예제 #1
0
        public XGBooster()
        {
            IntPtr tempPtr;
            var    output = XGBoostNative.XGBoosterCreate(null, 0, out tempPtr);

            if (output == -1)
            {
                throw new DllFailException(XGBoostNative.XGBGetLastError());
            }
            handle = tempPtr;
        }
예제 #2
0
        public XGBooster(DMatrix train)
        {
            var dmats  = new[] { train.Handle };
            var len    = unchecked ((ulong)dmats.Length);
            var output = XGBoostNative.XGBoosterCreate(dmats, len, out handle);

            if (output == -1)
            {
                throw new DllFailException(XGBoostNative.XGBGetLastError());
            }
        }
예제 #3
0
        public XGBooster(string fileName, int silent = 1)
        {
            IntPtr tempPtr;
            var    newBooster = XGBoostNative.XGBoosterCreate(null, 0, out tempPtr);
            var    output     = XGBoostNative.XGBoosterLoadModel(tempPtr, fileName);

            if (output == -1)
            {
                throw new DllFailException(XGBoostNative.XGBGetLastError());
            }
            handle = tempPtr;
        }
예제 #4
0
        public XGBooster(IDictionary <string, object> parameters, DMatrix train)
        {
            var dmats  = new[] { train.Handle };
            var len    = unchecked ((ulong)dmats.Length);
            var output = XGBoostNative.XGBoosterCreate(dmats, len, out handle);

            if (output == -1)
            {
                throw new DllFailException(XGBoostNative.XGBGetLastError());
            }
            SetParameters(parameters);
        }