AdaBoostStumpClassifier MethodError: zero(::Type{Symbol})
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- julia
- Domain
- machine-learning
Research direction
Start at the AdaBoostStumpClassifier implementation and its fit! method, then run the supplied Julia MWE with both datasets and iteration counts. Trace the failing path that produces zero(::Type{Symbol}); done means fitting succeeds for the reproduced labeled data with n_iterations greater than 5.
Written by the indexing model from the issue text.
Description
The function fit! fails with number of iterations > 5.
bdt = let
_model = AdaBoostStumpClassifier(; n_iterations = 10)
fit!(_model, X_train, y_train)
end
fails with an error,
MethodError: no method matching zero(::Type{Symbol})
The function `zero` exists, but no method is defined for this combination of argument types.
Closest candidates are:
zero(::Type{Union{}}, Any...)
@ Base number.jl:310
zero(::Type{Dates.DateTime})
@ Dates ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Dates/src/types.jl:458
zero(::Type{Pkg.Resolve.VersionWeight})
@ Pkg ~/.julia/juliaup/julia-1.11.5+0.aarch64.apple.darwin14/share/julia/stdlib/v1.11/Pkg/src/Resolve/versionweights.jl:15
...
It depends on dataset to train, see MWE, it works on one set, fails on the other
MWE
begin
using Random
using DataFrames
using DecisionTree
Random.seed!(1234)
end
function classify_signal_background(x, y)
# Sinusoidal boundary
# if sin(2.5π * (x - 0.55)) / 5 + 0.3 + 0.4x < y < 0.7 + 0.4x # note: this one has no problem
if (x-0.25)^2 + (y-0.25)^2 < 0.05 || (x-0.65)^2 + (y-0.65)^2 < 0.05
return :signal
else
return :background
end
end
const features = [:f1, :f2];
df = let
_df = DataFrame(rand(500, 2), features)
transform!(_df, features => ByRow(classify_signal_background) => :y)
end
bdt = let
_model = AdaBoostStumpClassifier(; n_iterations = 40)
X_train = df[:,features] |> Matrix
y_train = df[:, :y]
fit!(_model,X_train, y_train)
end
- Dominant language
- Julia
- Stars
- 365
- Forks
- 100
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from JuliaAI/DecisionTree.jl
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaAI/DecisionTree.jl#230 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
JuliaAI/DecisionTree.jl#225 · 2 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 20/100
JuliaAI/DecisionTree.jl#222 · 1 comment ·
-
good first issue
Difficulty 3/5 1-2 days Newbie friendliness 35/100
JuliaAI/DecisionTree.jl#217 · 4 comments ·
-
documentation
Difficulty 4/5 3-5 days Newbie friendliness 35/100
JuliaAI/DecisionTree.jl#215 ·
All issues in JuliaAI/DecisionTree.jl
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
Sienna-Platform/PowerSimulations.jl#1737 ·
Maintainers usually reply within 4 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
FluxML/Optimisers.jl#254 ·
-
Minor: floodplain warning percentage, scalar output error message and a never-true identity checkOpenbug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
JuliaAI/MLJTransforms.jl#101 ·
Maintainers usually reply within 1 day
-
@contents blocks fail to render on Julia 1.14Possibly taken @sbfnk claimed this 1 day ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
LuxDL/DocumenterVitepress.jl#410 ·