Skip to content

Commit 84acf4e

Browse files
Mamba413claudehappy-otter
committed
fix: use correct TargetTags.positive_only field for sklearn 1.7 compatibility
sklearn 1.7 added __slots__ to tags dataclasses, making arbitrary attribute assignment raise AttributeError. Replace required_positive (non-existent field) with positive_only (correct field in sklearn 1.6 and 1.7). Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude <noreply@anthropic.com> Co-Authored-By: Happy <yesreply@happy.engineering>
1 parent 8235a6c commit 84acf4e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

python/abess/linear.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,7 @@ def _more_tags(self):
10351035
def __sklearn_tags__(self):
10361036
tags = super().__sklearn_tags__()
10371037
tags.regressor_tags.poor_score = True
1038-
tags.target_tags.required_positive = True
1038+
tags.target_tags.positive_only = True
10391039
return tags
10401040

10411041
def predict(self, X):

0 commit comments

Comments
 (0)