Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in tutorial while fitting decoding model #3

Closed
geigermartin opened this issue Jan 5, 2024 · 3 comments
Closed

Error in tutorial while fitting decoding model #3

geigermartin opened this issue Jan 5, 2024 · 3 comments

Comments

@geigermartin
Copy link

Hi!

I was trying to run the tutorial overlapcorrectedLDA.jl, however, while fitting the decoding model, I'm running into this error:

ERROR: LoadError: TaskFailedException

    nested task error: MethodError: no method matching (::Colon)(::Int64, ::Tuple{Int64, Int64})
    
    Closest candidates are:
      (::Colon)(::T, ::Any, ::T) where T<:Real
       @ Base range.jl:45
      (::Colon)(::A, ::Any, ::C) where {A<:Real, C<:Real}
       @ Base range.jl:10
      (::Colon)(::A, ::Any, ::C) where {A<:Real, C<:Unitful.Quantity}
       @ Unitful ~/.julia/packages/Unitful/R4J37/src/range.jl:86
      ...
    
    Stacktrace:
     [1] macro expansion
       @ ~/.julia/packages/UnfoldDecode/fJ8fu/src/fit.jl:43 [inlined]
     [2] (::UnfoldDecode.var"#801#threadsfor_fun#5"{UnfoldDecode.var"#801#threadsfor_fun#4#6"{Symbol, NamedTuple{(), Tuple{}}, Dict{DataType, Tuple{StatsModels.FormulaTerm{StatsModels.ConstantTerm{Int64}, Tuple{StatsModels.ConstantTerm{Int64}, StatsModels.Term, StatsModels.Term}}, FIRBasis}}, DataFrames.DataFrame, Matrix{Float64}, MLJMultivariateStatsInterface.LDA, Pair{DataType, Symbol}, Vector{UnfoldDecode.DecodingFit}, Vector{Tuple{Vector{Int64}, UnitRange{Int64}}}, UnitRange{Int64}}})(tid::Int64; onethread::Bool)
       @ UnfoldDecode ./threadingconstructs.jl:206
     [3] #801#threadsfor_fun
       @ ./threadingconstructs.jl:173 [inlined]
     [4] (::Base.Threads.var"#1#2"{UnfoldDecode.var"#801#threadsfor_fun#5"{UnfoldDecode.var"#801#threadsfor_fun#4#6"{Symbol, NamedTuple{(), Tuple{}}, Dict{DataType, Tuple{StatsModels.FormulaTerm{StatsModels.ConstantTerm{Int64}, Tuple{StatsModels.ConstantTerm{Int64}, StatsModels.Term, StatsModels.Term}}, FIRBasis}}, DataFrames.DataFrame, Matrix{Float64}, MLJMultivariateStatsInterface.LDA, Pair{DataType, Symbol}, Vector{UnfoldDecode.DecodingFit}, Vector{Tuple{Vector{Int64}, UnitRange{Int64}}}, UnitRange{Int64}}}, Int64})()
       @ Base.Threads ./threadingconstructs.jl:145
Stacktrace:
 [1] threading_run(fun::UnfoldDecode.var"#801#threadsfor_fun#5"{UnfoldDecode.var"#801#threadsfor_fun#4#6"{Symbol, NamedTuple{(), Tuple{}}, Dict{DataType, Tuple{StatsModels.FormulaTerm{StatsModels.ConstantTerm{Int64}, Tuple{StatsModels.ConstantTerm{Int64}, StatsModels.Term, StatsModels.Term}}, FIRBasis}}, DataFrames.DataFrame, Matrix{Float64}, MLJMultivariateStatsInterface.LDA, Pair{DataType, Symbol}, Vector{UnfoldDecode.DecodingFit}, Vector{Tuple{Vector{Int64}, UnitRange{Int64}}}, UnitRange{Int64}}}, static::Bool)
   @ Base.Threads ./threadingconstructs.jl:163
 [2] macro expansion
   @ ./threadingconstructs.jl:211 [inlined]
 [3] macro expansion
   @ ~/.julia/packages/Unfold/3KeNp/src/utilities.jl:169 [inlined]
 [4] fit(UnfoldDecodingModel::Type{UnfoldDecodingModel}, design::Dict{DataType, Tuple{StatsModels.FormulaTerm{StatsModels.ConstantTerm{Int64}, Tuple{StatsModels.ConstantTerm{Int64}, StatsModels.Term, StatsModels.Term}}, FIRBasis}}, tbl::DataFrames.DataFrame, dat::Matrix{Float64}, model::MLJMultivariateStatsInterface.LDA, target::Pair{DataType, Symbol}; nfolds::Int64, eventcolumn::Symbol, UnfoldFitkwargs::NamedTuple{(), Tuple{}}, multithreading::Bool)
   @ UnfoldDecode ~/.julia/packages/UnfoldDecode/fJ8fu/src/fit.jl:26
 [5] top-level scope
   @ ~/Julia/overlapcorrectedLDA.jl:29
 [6] include(fname::String)
   @ Base.MainInclude ./client.jl:478
 [7] top-level scope
   @ REPL[4]:1
in expression starting at /home/marting/Julia/overlapcorrectedLDA.jl:29
@behinger
Copy link
Member

behinger commented Jan 8, 2024

indeed, the documentation fails here as well

@behinger
Copy link
Member

behinger commented Jan 8, 2024

I will only work on this after the changes in Unfold on predict are made. Hope this is not urgent work, happy to take PRs as well, but there are no unittests yet, so I wouldnt trust my code that much anyway;)

@behinger
Copy link
Member

ok - this is now fixed. There was a mistake in the implementation anyway, where I did not correct for overlap of same events,only of overlap of other events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants