EstimatorReport.inspection.coefficients#
- EstimatorReport.inspection.coefficients()[source]#
Retrieve the coefficients of a linear model, including the intercept.
- Returns:
CoefficientsDisplayThe feature importance display containing model coefficients and intercept.
Examples
>>> from sklearn.datasets import load_diabetes >>> from sklearn.linear_model import Ridge >>> from skore import train_test_split >>> from skore import EstimatorReport >>> X, y = load_diabetes(return_X_y=True) >>> split_data = train_test_split(X=X, y=y, shuffle=False, as_dict=True) >>> regressor = Ridge() >>> report = EstimatorReport(regressor, **split_data) >>> display = report.inspection.coefficients() >>> display.frame() feature coefficients 0 Intercept 151.4... 1 Feature #0 30.6... 2 Feature #1 -69.8... 3 Feature #2 254.8... 4 Feature #3 168.3... 5 Feature #4 18.3... 6 Feature #5 -19.5... 7 Feature #6 -134.6... 8 Feature #7 117.2... 9 Feature #8 242.1... 10 Feature #9 113.2... >>> display.plot() # shows plot