MCPcopy Create free account
hub / github.com/catboost/catboost / get_object_importance

Method get_object_importance

catboost/python-package/catboost/core.py:3603–3679  ·  view source on GitHub ↗

This is the implementation of the LeafInfluence algorithm from the following paper: https://arxiv.org/pdf/1802.06640.pdf Parameters ---------- pool : Pool The pool for which you want to evaluate the object importances. train_pool : Pool

(
            self, pool, train_pool, top_size=-1, type='Average', update_method='SinglePoint',
            importance_values_sign='All', thread_count=-1, verbose=False, ostr_type=None,
            log_cout=None, log_cerr=None)

Source from the content-addressed store, hash-verified

3601 return np.array(result)
3602
3603 def get_object_importance(
3604 self, pool, train_pool, top_size=-1, type='Average', update_method='SinglePoint',
3605 importance_values_sign='All', thread_count=-1, verbose=False, ostr_type=None,
3606 log_cout=None, log_cerr=None):
3607 """
3608 This is the implementation of the LeafInfluence algorithm from the following paper:
3609 https://arxiv.org/pdf/1802.06640.pdf
3610
3611 Parameters
3612 ----------
3613 pool : Pool
3614 The pool for which you want to evaluate the object importances.
3615
3616 train_pool : Pool
3617 The pool on which the model has been trained.
3618
3619 top_size : int (default=-1)
3620 Method returns the result of the top_size most important train objects.
3621 If -1, then the top size is not limited.
3622
3623 type : string, optional (default='Average')
3624 Possible values:
3625 - Average (Method returns the mean train objects scores for all input objects)
3626 - PerObject (Method returns the train objects scores for every input object)
3627
3628 importance_values_sign : string, optional (default='All')
3629 Method returns only Positive, Negative or All values.
3630 Possible values:
3631 - Positive
3632 - Negative
3633 - All
3634
3635 update_method : string, optional (default='SinglePoint')
3636 Possible values:
3637 - SinglePoint
3638 - TopKLeaves (It is posible to set top size : TopKLeaves:top=2)
3639 - AllPoints
3640 Description of the update set methods are given in section 3.1.3 of the paper.
3641
3642 thread_count : int, optional (default=-1)
3643 Number of threads.
3644 If -1, then the number of threads is set to the number of CPU cores.
3645
3646 verbose : bool or int
3647 If False, then evaluation is not logged. If True, then each possible iteration is logged.
3648 If a positive integer, then it stands for the size of batch N. After processing each batch, print progress
3649 and remaining time.
3650
3651 ostr_type : string, deprecated, use type instead
3652
3653 log_cout: output stream or callback for logging (default=None)
3654 If None is specified, sys.stdout is used
3655
3656 log_cerr: error stream or callback for logging (default=None)
3657 If None is specified, sys.stderr is used
3658
3659 Returns
3660 -------

Calls 6

isinstanceFunction · 0.85
is_fittedMethod · 0.80
_calc_ostrMethod · 0.80
log_fixupFunction · 0.70
CatBoostErrorClass · 0.50
intFunction · 0.50