|
pulsatrix 1.1.0
|
ICE curves for one feature: curves[i][k] = f(x_i with feature j set to grid[k])[target].
More...
#include <ice.hpp>
Public Member Functions | |
| std::vector< float > | partial_dependence () const |
| The partial dependence curve: the mean of the curves at each grid point. | |
| std::vector< float > | centered (int64_t anchor=0) const |
Centered ICE (c-ICE): each curve minus its value at grid[anchor], so curves that differ only by an offset coincide and differing shapes stand out. | |
| std::vector< float > | derivative () const |
| Derivative ICE (d-ICE): the slope of each curve, by central differences inside the grid and one-sided differences at its ends (numpy.gradient). Where the slopes vary across instances at the same grid point, the feature interacts with others there. | |
Public Attributes | |
| int64_t | feature_index = 0 |
| int64_t | target_index = 0 |
| std::vector< float > | grid |
| int64_t | num_instances = 0 |
| std::vector< float > | curves |
| Row-major (num_instances, grid.size()). | |
| std::vector< float > | feature_values |
| Each instance's own value of the feature, where its prediction sits on its curve. | |
ICE curves for one feature: curves[i][k] = f(x_i with feature j set to grid[k])[target].
Goldstein et al. (2015). The partial dependence curve is their mean, so ICE shows what PDP averages away: instances whose response to the feature differs, which is the signature of an interaction.
| std::vector< float > pulsatrix::IceResult::centered | ( | int64_t | anchor = 0 | ) | const |
Centered ICE (c-ICE): each curve minus its value at grid[anchor], so curves that differ only by an offset coincide and differing shapes stand out.
| std::out_of_range | if anchor is not a grid index. |
| std::vector< float > pulsatrix::IceResult::derivative | ( | ) | const |
Derivative ICE (d-ICE): the slope of each curve, by central differences inside the grid and one-sided differences at its ends (numpy.gradient). Where the slopes vary across instances at the same grid point, the feature interacts with others there.
| std::logic_error | if the grid has fewer than 2 points. |
| std::vector< float > pulsatrix::IceResult::partial_dependence | ( | ) | const |
The partial dependence curve: the mean of the curves at each grid point.
| std::vector<float> pulsatrix::IceResult::curves |
Row-major (num_instances, grid.size()).
| int64_t pulsatrix::IceResult::feature_index = 0 |
| std::vector<float> pulsatrix::IceResult::feature_values |
Each instance's own value of the feature, where its prediction sits on its curve.
| std::vector<float> pulsatrix::IceResult::grid |
| int64_t pulsatrix::IceResult::num_instances = 0 |
| int64_t pulsatrix::IceResult::target_index = 0 |