CrossValidationReport.feature_importance.coefficients#

CrossValidationReport.feature_importance.coefficients()[source]#

Retrieve the coefficients across splits, including the intercept.

Returns:
CoefficientsDisplay

The feature importance display containing model coefficients and intercept.

Examples

>>> from sklearn.datasets import make_regression
>>> from sklearn.linear_model import Ridge
>>> from skore import CrossValidationReport
>>> X, y = make_regression(n_features=3, random_state=42)
>>> report = CrossValidationReport(
>>>     estimator=Ridge(), X=X, y=y, splitter=5, n_jobs=4
>>> )
>>> display = report.feature_importance.coefficients()
>>> display.frame()
    split     feature  coefficients
0       0   Intercept      0.0...
1       0  Feature #0     74.1...
2       0  Feature #1     27.3...
3       0  Feature #2     17.3...
4       1   Intercept      0.0...
5       1  Feature #0     74.2...
6       1  Feature #1     27.5...
7       1  Feature #2     17.3...
8       2   Intercept      0.0...
9       2  Feature #0     74.1...
10      2  Feature #1     27.6...
11      2  Feature #2     17.2...
12      3   Intercept      0.1...
13      3  Feature #0     74.2...
14      3  Feature #1     27.5...
15      3  Feature #2     17.3...
16      4   Intercept      0.0...
17      4  Feature #0     74.2...
18      4  Feature #1     27.5...
19      4  Feature #2     17.3...
>>> display.plot() # shows plot