Why matrix field of struct ContrastsMatrix is Matrix{Float64}? For many cases fo DummyCoding() or FullDummyCoding() this can be BitMatrix or SparseMatrixCSC{Bool, Int64}.
For big datasets I try to make something like this:
mutable struct OwnDummyCoding <: AbstractContrasts
# Dummy contrasts
end
function StatsModels.contrasts_matrix(C::OwnDummyCoding, baseind, n)
sparse(I, n, n)[:, [1:(baseind-1); (baseind+1):n]]
end
But I have memory overflow because ContrastsMatrix tries to convert this to Matrix{Float64}.
Why matrix field of struct ContrastsMatrix is Matrix{Float64}? For many cases fo DummyCoding() or FullDummyCoding() this can be BitMatrix or SparseMatrixCSC{Bool, Int64}.
For big datasets I try to make something like this:
But I have memory overflow because ContrastsMatrix tries to convert this to Matrix{Float64}.