Machine-learning model API
ChoquetRegressor
Least-squares scikit-learn regressor with a learned capacity and separate intercept.
ChoquetRegressor
ChoquetRegressor(
sparsity: CapacitySparsity | None = None,
solver: Solver | str = "scipy",
solver_options: dict[str, Any] | None = None,
penalty: Any = None,
fit_intercept: bool = True,
)
Bases: RegressorMixin, BaseEstimator
Least-squares regression with a learned Choquet integral.
The estimator learns a normalized monotone capacity together with an unconstrained intercept. It follows the scikit-learn estimator contract and can be used in pipelines, cross-validation, grid search, pickle, and joblib.
Parameters
sparsity : CapacitySparsity, optional
Capacity parameterization. None fits a full explicit capacity.
solver : {"scipy", "cvxpy", "pymoo"} or Solver, default="scipy"
Optimization backend.
solver_options : dict, optional
Keyword arguments forwarded to the selected backend.
penalty : callable or penalty object, optional
Regularization term added to the squared-error objective.
fit_intercept : bool, default=True
Whether to learn an unconstrained additive intercept. Set to False
when the Choquet integral itself must be the complete prediction, as in
model aggregation.
Attributes
capacity_ : BaseCapacity
Fitted immutable capacity.
intercept_ : float
Fitted additive intercept.
universe_ : VariableUniverse
Feature universe inferred from X.
problem_ : Problem
Solver-independent optimization problem used during fitting.
result_ : OptimizationResult
Numerical optimizer result and diagnostics.
n_features_in_ : int
Number of input features seen during :meth:fit.
feature_names_in_ : ndarray of str
Input feature names when X provides string column names.
Notes
Inputs should be made commensurable before fitting, typically with
:class:~capacities_ml_fin.ml.preprocessing.CapacityNormalizer.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
fit
Fit the capacity and the regression intercept.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
predict
Predict continuous responses.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
fit_predict
get_feature_names_out
Return the feature names used by the fitted estimator.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
ScaledChoquetRegressor
Scaled Choquet regression \(c + qC_\mu(x)\) with a normalized monotone capacity, a learned intercept, and configurable bounds on \(q\).
ScaledChoquetRegressor
ScaledChoquetRegressor(
sparsity: CapacitySparsity | None = None,
solver: Solver | str = "scipy",
solver_options: dict[str, Any] | None = None,
penalty: Any = None,
q_bounds: tuple[float, float] = (0.0, inf),
)
Bases: RegressorMixin, BaseEstimator
Least-squares regression of the form c + q * C_mu(X).
This separate estimator implements the scaled Choquet submodel discussed by
Grabisch after Wang et al. The capacity remains normalized and monotone;
q controls the response scale without changing that normalization.
Parameters
sparsity : CapacitySparsity, optional
Capacity parameterization. None fits a full explicit capacity.
solver : {"scipy", "pymoo"} or Solver, default="scipy"
Numerical backend. CVXPY is unavailable because q * C_mu is
bilinear in the jointly learned parameters.
solver_options : dict, optional
Keyword arguments forwarded to the selected backend.
penalty : callable or penalty object, optional
Regularization added to the squared-error objective.
q_bounds : pair of float, default=(0.0, inf)
Bounds for q. The nonnegative default preserves monotonicity of the
complete regression function. Negative values can be enabled explicitly.
Attributes
capacity_ : BaseCapacity
Fitted normalized monotone capacity.
q_ : float
Fitted scale multiplying the Choquet integral.
intercept_ : float
Fitted error-center/intercept c.
problem_ : Problem
Joint constrained optimization problem.
result_ : OptimizationResult
Numerical optimizer result and diagnostics.
Notes
The initial q and c are obtained by ordinary least squares for the
initial feasible capacity, as in the paper's proposed submodels. Joint
numerical minimization then retains all capacity and q constraints.
Inputs must be commensurable before aggregation.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
fit
Fit the capacity, scale q, and intercept c.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
predict
Predict continuous responses.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
fit_predict
get_feature_names_out
Return the feature names used by the fitted estimator.
Source code in src/capacities_ml_fin/ml/models/regression/choquet.py
ChoquetClassifier
Deterministic binary threshold classifier. Inputs must lie in \([0,1]\) and be oriented so larger values favor the positive class. It exposes choquet_score() and decision_function() but intentionally no predict_proba().
ChoquetClassifier
ChoquetClassifier(
sparsity: CapacitySparsity | None = None,
solver: Solver | str = "pymoo",
solver_options: dict[str, Any] | None = None,
penalty: Any = None,
learn_feature_scales: bool = True,
)
Bases: ClassifierMixin, BaseEstimator
Binary threshold classifier based on a learned Choquet score.
The decision rule compares C_mu(b * x) with a learned threshold. When
feature scaling is enabled, non-negative scales b are fitted jointly
with the capacity and normalized to have maximum one. Inputs must lie in
[0, 1] and larger values must favor the positive class.
Parameters
sparsity : CapacitySparsity, optional
Capacity parameterization. None fits a full explicit capacity.
solver : {"scipy", "cvxpy", "pymoo"} or Solver, default="pymoo"
Optimization backend. PYMOO is suitable for the discontinuous zero-one
training loss.
solver_options : dict, optional
Keyword arguments forwarded to the selected backend.
penalty : callable or penalty object, optional
Regularization term added to the classification objective.
learn_feature_scales : bool, default=True
Whether to jointly learn normalized criterion scales.
Attributes
classes_ : ndarray of shape (2,)
Original binary class labels.
capacity_ : BaseCapacity
Fitted immutable capacity.
threshold_ : float
Learned decision threshold in [0, 1].
feature_scales_ : ndarray of shape (n_features,)
Learned scales, or ones when scale learning is disabled.
result_ : OptimizationResult
Numerical optimizer result and diagnostics.
n_features_in_ : int
Number of input features seen during :meth:fit.
Notes
The model is a deterministic classifier and therefore intentionally does
not implement predict_proba. Use :meth:decision_function to inspect
signed margins around the fitted threshold.
Source code in src/capacities_ml_fin/ml/models/classification/linear.py
fit
Fit the capacity, optional feature scales and decision threshold.
Source code in src/capacities_ml_fin/ml/models/classification/linear.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 | |
decision_function
Return signed margins relative to the learned decision threshold.
choquet_score
Return the Choquet projection before thresholding.
Source code in src/capacities_ml_fin/ml/models/classification/linear.py
predict
Predict binary labels using the fitted threshold.
Source code in src/capacities_ml_fin/ml/models/classification/linear.py
get_feature_names_out
Return the feature names used by the fitted estimator.
Source code in src/capacities_ml_fin/ml/models/classification/linear.py
ChoquisticRegression
Probabilistic binary Choquet classifier with latent utility \(C_\mu(x)\) and logistic link \(\gamma(C_\mu(x)-\beta)\).
ChoquisticRegression
ChoquisticRegression(
sparsity: CapacitySparsity | None = None,
solver: Solver | str = "scipy",
solver_options: dict[str, Any] | None = None,
class_weight: dict[Any, float] | str | None = None,
penalty: Any = None,
)
Bases: ClassifierMixin, BaseEstimator
Probabilistic binary regression with a Choquet logistic link.
The latent utility is C_mu(x) and the positive-class log-odds are
gamma * (C_mu(x) - beta). The normalized monotone capacity mu,
location beta, and positive scale gamma are learned jointly.
Parameters
sparsity : CapacitySparsity, optional
Capacity parameterization. None uses a k-additive default.
solver : {"scipy", "cvxpy", "pymoo"} or Solver, default="scipy"
Optimization backend.
solver_options : dict, optional
Options forwarded to the backend.
class_weight : dict, "balanced", or None, default=None
Per-class weights applied to the negative log-likelihood.
penalty : callable or penalty object, optional
Regularization term added to the objective.
Attributes
classes_ : ndarray of shape (2,)
Original binary labels.
capacity_ : BaseCapacity
Fitted immutable capacity.
beta_ : float
Learned utility location.
gamma_ : float
Learned positive log-odds scale.
result_ : OptimizationResult
Numerical optimizer result and diagnostics.
n_features_in_ : int
Number of features seen during :meth:fit.
Notes
Unlike :class:ChoquetClassifier, this model defines positive-class
probabilities through the logistic link and implements predict_proba.
Source code in src/capacities_ml_fin/ml/models/classification/choquistic.py
fit
fit(
X: ArrayLike,
y: ArrayLike,
sample_weight: ArrayLike | None = None,
) -> "ChoquisticRegression"
Fit the capacity, utility threshold and scale by maximum likelihood.
Source code in src/capacities_ml_fin/ml/models/classification/choquistic.py
104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 | |
utility_function
Return the latent utility C_mu(X) from the paper's first stage.
Source code in src/capacities_ml_fin/ml/models/classification/choquistic.py
decision_function
Return the fitted log-odds gamma * (C_mu(X) - beta).
Source code in src/capacities_ml_fin/ml/models/classification/choquistic.py
predict_proba
Return probabilities for the two encoded classes.
predict_log_proba
Return numerically stable log-probabilities.
Source code in src/capacities_ml_fin/ml/models/classification/choquistic.py
predict
Predict class labels using a probability threshold of 0.5.
get_feature_names_out
Return the feature names used by the fitted estimator.
Source code in src/capacities_ml_fin/ml/models/classification/choquistic.py
ChoquetAutoRegressor
Native sktime univariate forecaster. It aggregates autoregressive lags through a capacity and supports optional exogenous regressors, recursive prediction intervals and updates.
ChoquetAutoRegressor
ChoquetAutoRegressor(
lags: int = 1,
sparsity: CapacitySparsity | None = None,
solver: Solver | str = "scipy",
solver_options: dict[str, Any] | None = None,
fit_intercept: bool = True,
enforce_stationarity: bool = True,
stability_bound: float = 0.999,
)
Bases: BaseForecaster
Univariate Choquet autoregression compatible with sktime.
The conditional mean is intercept + phi * C_nu(y[t-1], ..., y[t-p]).
Optional exogenous variables enter additively. When stationarity is
enforced, abs(phi) <= stability_bound < 1.
Parameters
lags : int, default=1
Number of lagged observations aggregated by the Choquet integral.
sparsity : CapacitySparsity or None, default=None
Capacity parametrization. None uses a full capacity.
solver : {"scipy", "pymoo"} or Solver, default="scipy"
Numerical optimizer used to estimate the model.
solver_options : dict or None, default=None
Options forwarded to :class:~capacities_ml_fin.ml.optimization.Optimizer.
fit_intercept : bool, default=True
Whether to estimate an intercept.
enforce_stationarity : bool, default=True
Whether to constrain the autoregressive scale to a contraction.
stability_bound : float, default=0.999
Absolute upper bound for phi when stationarity is enforced.
Attributes
capacity_ : BaseCapacity
Capacity learned over lagged observations.
phi_ : float
Autoregressive scale multiplying the Choquet aggregate.
intercept_ : float
Fitted intercept, or zero when fit_intercept=False.
exogenous_coef_ : ndarray
Coefficients of optional exogenous regressors.
fittedvalues_ : Series
In-sample conditional-mean estimates after the initial lags.
resid_ : Series
In-sample residuals aligned with fittedvalues_.
result_ : OptimizationResult
Numerical optimizer result and diagnostics.
order_ : tuple of int
AR-style order (lags, 0, 0).
Notes
Forecasts beyond one step are generated recursively through the sktime forecasting horizon interface.
Source code in src/capacities_ml_fin/ml/models/time_series/choquet.py
resid
aic
bic
Return the Gaussian Bayesian information criterion.
get_test_params
classmethod
Return a fast configuration for sktime estimator checks.