ContinuousEncoder docstring: wrong `drop_last` default and nonexistent `ordered_factors` option
I maintainer di solito rispondono entro 1 giorno
Valutazione
- Difficoltà
- 1/5
- Tempo stimato
- Meno di un'ora
- Idoneità per principianti
- 88/100
- Tipo di issue
- Documentazione
- Chiarezza
- Specificata chiaramente
- Stato di attività
- Attiva
- Ambito
- documentation
Direzione di ricerca
Leggi il docstring di ContinuousEncoder in src/transformers/other_transformers/continuous_encoder.jl, in particolare le sezioni Protocol e Hyper-parameters. Correggi il valore predefinito indicato per drop_last, chiarisci che one_hot_ordered_factors=true abilita la codifica one-hot per i fattori ordinati e completa la descrizione troncata dell’opzione. Il lavoro è completato quando il testo corrisponde ai valori predefiniti della struct e al comportamento delle keyword supportate mostrati nell’issue.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
The docstring for ContinuousEncoder has the same kind of problem that #57 fixed for OneHotEncoder, plus a reference to a keyword that doesn't exist.
In src/transformers/other_transformers/continuous_encoder.jl the struct is
@with_kw_noshow mutable struct ContinuousEncoder <: Unsupervised
drop_last::Bool = false
one_hot_ordered_factors::Bool = false
end
but the docstring says:
- Hyper-parameters section (L132):
drop_last=true, while the actual default isfalse. - Protocol section (L97-L100): an
OrderedFactoris coerced toContinuous"unlessordered_factors=falseis specified, in which case one-hot encode it". There is noordered_factorsfield, and the logic is the other way round: you get one-hot encoding by passingone_hot_ordered_factors=true.
Also the one_hot_ordered_factors bullet ends mid-sentence ("...coerce it directly to a (single) Continuous feature using the order").
Example
using MLJBase, MLJTransforms, CategoricalArrays
m = ContinuousEncoder()
@show m.drop_last m.one_hot_ordered_factors
X = (name=categorical(["Danesh", "Lee", "Mary", "John"]),
grade=categorical(["A", "B", "A", "C"], ordered=true),
height=[1.85, 1.67, 1.5, 1.67])
W = MLJBase.transform(fit!(machine(ContinuousEncoder(), X), verbosity=0), X)
@show keys(W)
W2 = MLJBase.transform(fit!(machine(ContinuousEncoder(one_hot_ordered_factors=true), X), verbosity=0), X)
@show keys(W2)
ContinuousEncoder(ordered_factors=false)
Output:
m.drop_last = false
m.one_hot_ordered_factors = false
keys(W) = (:name__Danesh, :name__John, :name__Lee, :name__Mary, :grade, :height)
keys(W2) = (:name__Danesh, :name__John, :name__Lee, :name__Mary, :grade__A, :grade__B, :grade__C, :height)
ERROR: LoadError: MethodError: no method matching ContinuousEncoder(; ordered_factors::Bool)
This method does not support all of the given keyword arguments (and may not support any).
Closest candidates are:
ContinuousEncoder(; drop_last, one_hot_ordered_factors) got unsupported keyword argument "ordered_factors"
So with the defaults all four name levels are kept (no column dropped), and following the protocol text literally just errors.
Expected
The docstring should say drop_last=false, and the protocol bullet should read something like "unless one_hot_ordered_factors=true is specified, in which case one-hot encode it". The example at the bottom already passes drop_last=true explicitly, so it's fine as is.
Versions
- MLJTransforms v0.2.4 (
devat d3e3db3) - MLJBase v1.15.4, CategoricalArrays v1.1.1
- Julia 1.13.3
- Lingua principale
- Julia
- Stelle
- 1
- Fork
- 5
- Merge medio
- 1g 4h
- PR unite (30g)
- 6
Preparare l'ambiente
Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di JuliaAI/MLJTransforms.jl
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
JuliaAI/MLJTransforms.jl#113 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 90/100
JuliaAI/MLJTransforms.jl#108 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
JuliaAI/MLJTransforms.jl#107 · 1 commento · 1 reazione ·
I maintainer di solito rispondono entro 1 giorno
-
next breaking release
Difficoltà 1/5 Meno di un'ora Idoneità per principianti 58/100
JuliaAI/MLJTransforms.jl#111 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 72/100
JuliaAI/MLJTransforms.jl#106 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di JuliaAI/MLJTransforms.jl
Issue simili
-
Overload == for ZGroupAperta
Difficoltà 2/5 1-3 ore Idoneità per principianti 66/100
-
question
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
brown-ccv/Chamber.jl#272 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 78/100
JuliaAstro/SolarPosition.jl#143 ·
-
distributions
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
JuliaBayes/Wren.jl#404 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 88/100
I maintainer di solito rispondono entro 1 giorno