Skip to content

Commit

Permalink
specify types of fields in MaxnetModel
Browse files Browse the repository at this point in the history
  • Loading branch information
tiemvanderdeure committed Jan 3, 2024
1 parent 91703a4 commit 9ef393a
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/MaxnetModel.jl
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
struct MaxnetModel
path
features
columns
coefs
alpha
entropy
path::Union{GLMNet.GLMNetPath, Lasso.LassoPath}
features::Vector{<:AbstractFeatureClass}
columns::Vector{ModelMatrixColumn}
coefs::AbstractVector
alpha::Float64
entropy::Float64
predictor_data
categorical_predictors
continuous_predictors
categorical_predictors::NTuple{<:Any, Symbol}
continuous_predictors::NTuple{<:Any, Symbol}
end

function Base.show(io::IO, mime::MIME"text/plain", m::MaxnetModel)
Expand All @@ -21,4 +21,5 @@ function Base.show(io::IO, mime::MIME"text/plain", m::MaxnetModel)
println(io, "Variables selected: $vars_selected")
end

"Get the number of non-zero coefficients in the model"
complexity(m::MaxnetModel) = length(m.coefs.nzval)

0 comments on commit 9ef393a

Please sign in to comment.