/// <summary> /// Container constructor. /// </summary> /// <param name="path">Path to the model file</param> public CatBoostModelContainer(string path) { ModelPath = path; ModelHandler = CatboostNativeInterface.ModelCalcerCreate(); if (!CatboostNativeInterface.LoadFullModelFromFile(ModelHandler, ModelPath)) { var msg = CatboostNativeInterface.GetErrorStringConst(ModelHandler); throw new CatBoostException( "An error has occurred in the LoadFullModelFromFile() method in catboostmodel library.\n" + $"Returned error message: {msg}" ); } }
/// <summary> /// Container constructor. /// </summary> /// <param name="path">Path to the model file</param> public CatBoostModelContainer(string path) { ModelPath = path; ModelHandler = CatboostNativeInterface.ModelCalcerCreate(); if (!CatboostNativeInterface.LoadFullModelFromFile(ModelHandler, ModelPath)) { string msg = ""; // TODO Call `GetErrorString` without crashing everything throw new CatBoostException( "An error has occurred in the LoadFullModelFromFile() method in catboostmodel library.\n" + $"Returned error message: {msg}" ); } }