Repository navigation
Conversation
edgararuiz
left a comment
There was a problem hiding this comment.
I also ran roborev review on this branch and these are the items it returned:
Findings
1. Medium
Location: R/tabpfn-fit.R:391
Problem: tabpfn_sample_rows() is not robust: a constant numeric outcome
produces only one quantile breakpoint, causing cut() to fail, while
per-stratum ceiling() can select more than training_set_limit rows (for
example, four classes with a limit of three selects at least four).
Fix: Use an exact-size allocation across strata, reject classification
limits below the number of classes, and handle constant numeric outcomes
without quartile cutting.
2. Medium
Location: R/tabpfn-fit.R:365
Problem: The bridge extracts the first outcome without validating that
outcomes are univariate or complete. A multi-column y is silently truncated,
while one NA in a numeric outcome makes target scaling NA and can fail the
default safepower members or produce invalid predictions.
Fix: Validate processed$outcomes as univariate, then reject or remove
rows with missing outcomes before sampling and target scaling.
3. Medium
Location: R/tabpfn-fit.R:323
Problem: softmax_temperature = 0 passes validation but is later used as a
divisor, producing infinite logits and generally NaN probabilities or
regression predictions.
Fix: Require softmax_temperature to be strictly greater than zero.
4. Medium
Location: R/tabpfn-predict.R:71
Problem: Zero-row new_data is still sent through inference. For
nonconstant regression and classification fits, both model versions evaluate
(num_train + 1):num_train, which is a descending two-element index rather
than an empty test slice, so prediction fails instead of returning zero rows.
Fix: After forging, short-circuit zero-row inputs and construct the
correctly typed empty prediction columns.
5. Medium
Location: R/pretrained-weights.R:107
Problem: The downloader ignores the return value of file.rename() and
reports success even if the completed temporary file could not be installed,
such as when the destination is locked on Windows or created concurrently.
Fix: Check that file.rename() succeeds and that the destination exists;
retry or abort with an actionable error otherwise.
See the slowness note in #144
This also makes the long CI run even longer.