Skip to content

V1.0.x#16

Merged
cpoli merged 23 commits intomasterfrom
v1.0.x
Apr 7, 2026
Merged

V1.0.x#16
cpoli merged 23 commits intomasterfrom
v1.0.x

Conversation

@cpoli
Copy link
Copy Markdown
Collaborator

@cpoli cpoli commented Apr 2, 2026

New version of Gators using Polars.

@cpoli cpoli requested a review from shreeeli April 2, 2026 11:51
result = encoder.transform(test_X)

# D and E should get default value 0.0 for all bits
d_row = (
"""Test that invalid operator raises ValidationError."""
from pydantic import ValidationError

X = pl.DataFrame({"A": [10, 20, 30], "B": [15, 10, 30]})
"""Test that invalid reference_date types raise ValidationError from Pydantic."""
from pydantic import ValidationError

X = pl.DataFrame({"offset": [1, 2, 3]})

def test_validation_mismatched_new_column_names_length():
"""Test validation error when new_column_names length doesn't match."""
X = pl.DataFrame({"value": [10, 20], "group": ["A", "B"]})

def test_validation_mismatched_new_column_names_length():
"""Test validation error when new_column_names length doesn't match."""
X = pl.DataFrame({"value": [10, 20], "group": ["A", "B"]})
# With low smoothing
encoder_low = LeaveOneOutEncoder(subset=["category"], smoothing=0.1, inplace=False)
encoder_low.fit(X, y=target)
result_low = encoder_low.transform(X)
# Strings 'a', 'b', 'c' are too short for trigrams
# Only 'ab' is still too short
# Should not have any n-grams or very few
new_features = [col for col in result.columns if col.startswith("text__ng_")]

def test_transform_drop_columns_multiple_groups():
"""Test drop_columns with multiple groups - validation should catch invalid group."""
X = pl.DataFrame({"A": [10, 20], "B": [5, 10], "C": [100, 200], "D": [50, 100]})

def test_empty_new_column_names_raises_error():
"""Test that empty new_column_names list raises ValueError."""
X = pl.DataFrame({"A": [10, 20, 30]})
}
)

y = pl.Series("target", [0, 0, 0, 1, 1])
Copy link
Copy Markdown
Collaborator

@shreeeli shreeeli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@cpoli cpoli merged commit 379adde into master Apr 7, 2026
10 of 11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants