pulsatrix 1.1.0
Loading...
Searching...
No Matches
pulsatrix::IceResult Struct Reference

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.
 

Detailed Description

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.

Member Function Documentation

◆ centered()

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.

Exceptions
std::out_of_rangeif anchor is not a grid index.

◆ derivative()

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.

Exceptions
std::logic_errorif the grid has fewer than 2 points.

◆ partial_dependence()

std::vector< float > pulsatrix::IceResult::partial_dependence ( ) const

The partial dependence curve: the mean of the curves at each grid point.

Member Data Documentation

◆ curves

std::vector<float> pulsatrix::IceResult::curves

Row-major (num_instances, grid.size()).

◆ feature_index

int64_t pulsatrix::IceResult::feature_index = 0

◆ feature_values

std::vector<float> pulsatrix::IceResult::feature_values

Each instance's own value of the feature, where its prediction sits on its curve.

◆ grid

std::vector<float> pulsatrix::IceResult::grid

◆ num_instances

int64_t pulsatrix::IceResult::num_instances = 0

◆ target_index

int64_t pulsatrix::IceResult::target_index = 0

The documentation for this struct was generated from the following file: