3.0 - #474
Conversation
andrewdalpino
commented
Sep 4, 2026
405 fix issues in stan
* Intial commit * Expand on new features * Update Pipeline initialization syntax in documentation Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> * Update cost function defaults in upgrade documentation Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com> --------- Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
| @@ -86,11 +116,17 @@ public function fit(Dataset $dataset) : void | |||
|
|
|||
| foreach ($dataset->featureTypes() as $column => $type) { | |||
| if ($type->isCategorical()) { | |||
There was a problem hiding this comment.
Found with LLM:
In 3.0, only floats are continuous. Integers are categorical. Several transformers still emit PHP integers (0 / 1 / counts), so they no longer produce continuous data.
Please:
- One Hot Encoder, Word Count Vectorizer, and Token Hashing Vectorizer — write floats (
0.0,1.0, float counts), not ints. - TF-IDF and BM25 — also write
0.0for zero cells. Today only positive values become floats, so a column can mixint 0and floats. - Docs (
upgrading-to-3.md) — say clearly that:- integer labels (e.g.
[1, 2, 3]) are categorical too, so regressors will reject them unless you cast labels to floats; - after One Hot / count vectorizers, add Float Type Converter (or emit floats in the transformer itself) before any continuous estimator or scaler.
- integer labels (e.g.
Without this, the usual path “One Hot → scaler → KMeans / Ridge / MLP” breaks, even if the user already cast their raw features.
There was a problem hiding this comment.
Nice find, taking a look!
There was a problem hiding this comment.
This is a tricky one because the output of One Hot Encoder and both word count vectorizers are valid ordered categories. The user has the option to interpret them as an continuous data if they want by casting them to floats using the new Float Type Converter. But I don't want to make that choice for the user - I would rather give them both options and let them decide albeit at the cost of an extra step. I also checked the Scikit implementation and they let you choose the datatype right from the transformer - just a different way of doing it.
I think the fix here is to document these specific examples in the migration guide.
There was a problem hiding this comment.
Yes, agree - it's better to leave it for user's interpretation.
|
Another found with LLM. WDYT about this? Does it make sense or relevant at all? Fix: do the same as AdaBoost — score the model after the new tree is in the ensemble, remember tree count, and roll back only if quality got worse. Three changes in train():
Use <, not <=. Use $bestEnsembleSize, not $bestEpoch. |
|
Which algo are you talking about @apphp? |
src/Regressors/GradientBoost.php |