(self, data, metrics, ntree_start, ntree_end, eval_period, thread_count, res_dir, tmp_dir, plot, plot_file, log_cout=None, log_cerr=None)
| 3210 | return self._get_embedding_feature_indices() |
| 3211 | |
| 3212 | def _eval_metrics(self, data, metrics, ntree_start, ntree_end, eval_period, thread_count, res_dir, tmp_dir, plot, plot_file, log_cout=None, log_cerr=None): |
| 3213 | if not self.is_fitted(): |
| 3214 | raise CatBoostError("There is no trained model to evaluate metrics on. Use fit() to train model. Then call this method.") |
| 3215 | if not isinstance(data, Pool): |
| 3216 | raise CatBoostError("Invalid data type={}, must be catboost.Pool.".format(type(data))) |
| 3217 | if data.is_empty_: |
| 3218 | raise CatBoostError("Data is empty.") |
| 3219 | if not isinstance(metrics, ARRAY_TYPES) and not isinstance(metrics, STRING_TYPES) and not isinstance(metrics, BuiltinMetric): |
| 3220 | raise CatBoostError("Invalid metrics type={}, must be array like, str or one of builtin catboost.metrics.* class instances.".format(type(metrics))) |
| 3221 | if not all(map(lambda metric: isinstance(metric, string_types) or isinstance(metric, BuiltinMetric), metrics)): |
| 3222 | raise CatBoostError("Invalid metric type: must be str or one of builtin catboost.metrics.* class instances.") |
| 3223 | if tmp_dir is None: |
| 3224 | tmp_dir = tempfile.mkdtemp() |
| 3225 | |
| 3226 | if isinstance(metrics, STRING_TYPES) or isinstance(metrics, BuiltinMetric): |
| 3227 | metrics = [metrics] |
| 3228 | metrics = stringify_builtin_metrics_list(metrics) |
| 3229 | with log_fixup(log_cout, log_cerr), plot_wrapper(plot, plot_file, 'Eval metrics plot', [res_dir]): |
| 3230 | metrics_score, metric_names = self._base_eval_metrics(data, metrics, ntree_start, ntree_end, eval_period, thread_count, res_dir, tmp_dir) |
| 3231 | |
| 3232 | return dict(zip(metric_names, metrics_score)) |
| 3233 | |
| 3234 | def eval_metrics(self, data, metrics, ntree_start=0, ntree_end=0, eval_period=1, thread_count=-1, tmp_dir=None, plot=False, plot_file=None, log_cout=None, log_cerr=None): |
| 3235 | """ |
no test coverage detected