You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: NEWS.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -6,6 +6,7 @@
6
6
* Fix: `PipeOpTextVectorizer` now uses coercion to `TsparseMatrix` instead of deprecated `dgTMatrix` to avoid `Matrix` deprecation warnings.
7
7
* New method `$predict_newdata_fast()` for `GraphLearner`. Note that currently this is only a thin wrapper around `$predict_newdata()` to maintain compatibility, but in the future it may get optimized to enable faster predictions on new data.
8
8
* feat: `PipeOpRenameColumns`'s hyperparameter `renaming` can now also take a function transforming old column names to new column names.
9
+
* feat: Added new hyperparameters `filter_score_transform`, `result_score_transform`, and `aggregator` to `FilterEnsemble`. BREAKING CHANGE: The default behavior for handling NA scores in the aggregation has changed. Previously, NA scores were simply ignored and weights were not changed. Now, `weighted.mean` is used, which normalizes the weights for all non-NA scores.
# Calculate filter scores, apply rank and filter score trafo
210
+
scores= map(private$.wrapped, function(x) {
172
211
x$calculate(task, nfeat)
173
212
s=x$scores[fn]
174
213
if (pv$rank_transform) s= rank(s, na.last="keep", ties.method="average")
175
-
s*w
214
+
s=pv$filter_score_transform(s)
215
+
if (!isTRUE(check_numeric(s, len=nfeat))) stopf("Filter score transformation did not return a numeric vector of the same length as there are features.")
216
+
s
176
217
})
177
-
scores_df= as.data.frame(scores)
178
-
combined= rowSums(scores_df, na.rm=TRUE)
179
-
all_missing= rowSums(!is.na(scores_df)) ==0L
218
+
scores_dt= as.data.table(scores)
219
+
220
+
# Aggregate across features
221
+
combined= apply(scores_dt, 1, pv$aggregator, w=weights, na.rm=TRUE) # weighted.mean normalizes weights in case of NAs
222
+
if (!isTRUE(check_numeric(combined, len=nfeat))) stopf("Aggregator did not return a numeric vector of the same length as there are scored features.")
223
+
# Apply result score trafo
224
+
combined=pv$result_score_transform(combined)
225
+
if (!isTRUE(check_numeric(combined, len=nfeat))) stopf("Result score transformation did not return a numeric vector of the same length as there are features.")
expect_error(po$train(list(task)), "Exactly one of 'nfeat', 'frac', 'cutoff', or 'permuted' must be given.*none")
19
+
expect_error(po$train(list(task)), "Exactly one hyperparameter of 'filter.nfeat', 'filter.frac', 'filter.cutoff', or 'filter.permuted' must be given.*none")
expect_error(po$train(list(task)), "Exactly one of 'nfeat', 'frac', 'cutoff', or 'permuted' must be given.*nfeat, frac")
22
+
expect_error(po$train(list(task)), "Exactly one hyperparameter of 'filter.nfeat', 'filter.frac', 'filter.cutoff', or 'filter.permuted' must be given.*nfeat, frac")
0 commit comments