Skip to content

skfolio/skfolio-hierarchical-seriation

Rule skfolio-hierarchical-seriation
Pack skfolio
Severity error
Fix unsafe, with xpd check --fix --unsafe-fixes
Library versions skfolio 1.14.4 and later

skfolio HRP and Schur configure their clustering through a HierarchicalSeriation estimator.

HierarchicalRiskParity(hierarchical_clustering_estimator=cluster)
HierarchicalRiskParity(seriation_estimator=HierarchicalSeriation(hierarchical_clustering_estimator=cluster))

The rule covers the two constructors and the legacy fitted alias. HERC still accepts hierarchical_clustering_estimator. NCO accepts clustering_estimator.

Use xpd check --fix for the fitted attribute hierarchical_clustering_estimator_ and xpd check --fix --unsafe-fixes to wrap hierarchical_clustering_estimator inside HierarchicalSeriation(...).

xpd prints this message with the issue. A name that starts with $ stands for code from your file.

skfolio HRP and Schur raise FutureWarning at fit for hierarchical_clustering_estimator. Put the clustering estimator inside HierarchicalSeriation.

Browse the other rules of the skfolio pack.