skfolio/skfolio-factor-model-class
| Pack | Severity | Fix | Versions |
|---|---|---|---|
| skfolio | error | unsafe, with xpd check --fix --unsafe-fixes |
skfolio 1.14.4+ |
The skfolio FactorModel dataclass holds fitted results. Fit a TimeSeriesFactorModel prior with the factor matrix in the keyword-only factors argument.
MeanRisk(prior_estimator=FactorModel())TimeSeriesFactorModel().fit(returns, factor_returns)MeanRisk(prior_estimator=TimeSeriesFactorModel())TimeSeriesFactorModel().fit(returns, factors=factor_returns)What the rule reports
Section titled “What the rule reports”To pass factors through an optimizer, request factors on the prior and pass the matrix to the optimizer's fit.
How to fix it
Section titled “How to fix it”Use xpd check --fix --unsafe-fixes to replace FactorModel() with TimeSeriesFactorModel() and to pass the positional factor matrix as factors=.
Diagnostic message
Section titled “Diagnostic message”FactorModel is a fitted skfolio container with 13 required inputs. Use TimeSeriesFactorModel as the prior estimator.See all rules in the skfolio pack.