public XGBooster() { IntPtr tempPtr; var output = XGBoostNative.XGBoosterCreate(null, 0, out tempPtr); if (output == -1) { throw new DllFailException(XGBoostNative.XGBGetLastError()); } handle = tempPtr; }
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()); } }
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; }
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); }