Skip to content

Commit

Permalink
remove model frame, store terms and offsets instead
Browse files Browse the repository at this point in the history
  • Loading branch information
maddyduran committed May 22, 2024
1 parent c1871b1 commit b11ca90
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions R/cell_count_model.R
Original file line number Diff line number Diff line change
Expand Up @@ -732,10 +732,14 @@ new_cell_count_model <- function(ccs,
# model_frame = model.frame(full_model_formula[-2], pln_data)
# xlevels = .getXlevels(terms(model_frame), model_frame)
full_model_frame = model.frame(full_model_formula[-2], pln_data)
full_model_terms = terms(full_model_frame)
full_model_xlevels = .getXlevels(terms(full_model_frame), full_model_frame)
full_model_offsets = model.offset(full_model_frame)

reduced_model_frame = model.frame(reduced_model_formula[-2], pln_data)
reduced_model_terms = terms(reduced_model_frame)
reduced_model_xlevels = .getXlevels(terms(reduced_model_frame), reduced_model_frame)
reduced_model_offsets = model.offset(reduced_model_frame)

# Choose a model that isn't very aggressively sparsified
best_reduced_model <- PLNmodels::getBestModel(reduced_pln_model, "EBIC")
Expand Down Expand Up @@ -778,11 +782,14 @@ new_cell_count_model <- function(ccs,
best_reduced_model = best_reduced_model,
reduced_model_family = reduced_pln_model,
sparsity = sparsity_factor,
# model_aux = SimpleList(model_frame=model_frame, xlevels=xlevels),
model_aux = SimpleList(full_model_frame=full_model_frame,
model_aux = SimpleList(full_model_terms=full_model_terms,
# full_model_frame=full_model_frame,
full_model_xlevels=full_model_xlevels,
reduced_model_frame=reduced_model_frame,
reduced_model_xlevels=reduced_model_xlevels),
full_model_offsets=full_model_offsets,
reduced_model_terms=reduced_model_terms,
# reduced_model_frame=reduced_model_frame,
reduced_model_xlevels=reduced_model_xlevels,
reduced_model_offsets=reduced_model_offsets ),
vhat = vhat,
vhat_method = vhat_method,
info=SimpleList()
Expand Down

0 comments on commit b11ca90

Please sign in to comment.