Exemple #1
0
 /// <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}"
                   );
     }
 }
Exemple #2
0
 /// <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}"
                   );
     }
 }