camroach87 / validatr

Validates predictions
MIT License
4 stars 0 forks source link

Support dplyr group_by() functionality #21

Open camroach87 opened 7 years ago

camroach87 commented 7 years ago

Does doing something like:

data %>%
  group_by(Group_Variable) %>%
  validatr(y = Response, data_type = "ts") %>%
  etc.

work? Does a separate validatr object get created for each group? Could this be added? Might allow for hierarchical reconciliation with a new function reconcile after the predictions. Just need to specify the hierarchical structure in validatr.

camroach87 commented 7 years ago

Use the indicies attribute of grouped tibble. Access with attr(*, "indices") and attr(*, "labels"). Make a grouped_validatr class. When fitting models, the models list element will be structured validatr$models$groups$folds. Need to create separate folds for each group.

camroach87 commented 7 years ago

Tibble should be structured as follows:

Group1 Group2 Fold Data Train_Index Validation_Index Model Predictions

Not sure if fold indices should be for entire original data frame or for data within groups