Skip to content

Commit 5e0af90

Browse files
committed
✨ Better callable features logic
1 parent 194c53e commit 5e0af90

File tree

3 files changed

+278
-278
lines changed

3 files changed

+278
-278
lines changed

src/generic.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -40,17 +40,17 @@ function generic_fit(X,
4040
feat_names = Tables.schema(X).names
4141

4242
#2. Modify column_names based on features
43-
if features isa Function
43+
if features isa AbstractVector{Symbol}
44+
# Original behavior for vector of symbols
45+
feat_names =
46+
(ignore) ? setdiff(feat_names, features) : intersect(feat_names, features)
47+
else
4448
# If features is a callable, apply it to each feature name
4549
if ignore
4650
feat_names = filter(name -> !features(name), feat_names)
4751
else
4852
feat_names = filter(features, feat_names)
4953
end
50-
else
51-
# Original behavior for vector of symbols
52-
feat_names =
53-
(ignore) ? setdiff(feat_names, features) : intersect(feat_names, features)
5454
end
5555

5656
# 3. Define mapping per column per level dictionary

0 commit comments

Comments
 (0)