Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
from .core import get_catboost_bin_module
_catboost = get_catboost_bin_module()
Tokenizer = _catboost.Tokenizer
Dictionary = _catboost.Dictionary
from .core import Pool, CatBoostError, get_catboost_bin_module, ARRAY_TYPES
from collections import defaultdict
from contextlib import contextmanager
import numpy as np
import warnings
_catboost = get_catboost_bin_module()
_eval_metric_util = _catboost._eval_metric_util
_get_roc_curve = _catboost._get_roc_curve
_get_confusion_matrix = _catboost._get_confusion_matrix
_select_threshold = _catboost._select_threshold
compute_wx_test = _catboost.compute_wx_test
TargetStats = _catboost.TargetStats
DataMetaInfo = _catboost.DataMetaInfo
compute_training_options = _catboost.compute_training_options
@contextmanager
def _import_matplotlib():
try:
import matplotlib.pyplot as plt
except ImportError as e:
import math
from .core import get_catboost_bin_module, CatBoost, CatBoostError
from .utils import _import_matplotlib
_catboost = get_catboost_bin_module()
FeatureExplanation = _catboost.FeatureExplanation
def _check_model(model):
if not isinstance(model, CatBoost):
raise CatBoostError("Model should be CatBoost")
def to_polynom(model):
_check_model(model)
return _catboost.to_polynom(model._object)
def to_polynom_string(model):
_check_model(model)
return _catboost.to_polynom_string(model._object)
from .core import get_catboost_bin_module
_catboost = get_catboost_bin_module()
is_groupwise_metric = _catboost.is_groupwise_metric
is_multiclass_metric = _catboost.is_multiclass_metric
is_pairwise_metric = _catboost.is_pairwise_metric
is_maximizable_metric = _catboost.is_maximizable_metric
is_minimizable_metric = _catboost.is_minimizable_metric
get_experiment_name = _catboost.get_experiment_name
def reset_trace_backend(filename):
get_catboost_bin_module()._reset_trace_backend(filename)
def get_gpu_device_count():
return get_catboost_bin_module()._get_gpu_device_count()