andosa / treeinterpreter

BSD 3-Clause "New" or "Revised" License
745 stars 140 forks source link

Treeinterpreter class interface #43

Closed geoochi closed 1 year ago

geoochi commented 1 year ago

After Optimized mean calculation routine in _predict_tree and _predict_forest:

  1. Used Treeinterpreter class as a user interface, in which:

    • model, X and joint_contribution needs to be passed in during initialization.
    • user can only use predict function
    • only tree can be passed through class methods.
  2. Used ThreadPoolExecutor to optimize mean calculation routine. When self.joint_contribution == False:

    • mean prediction, biases and contributions set to class attributes
    • _predict_tree function caculate results and adds to these three class attributes without return