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

Features/clean prediction #81

Merged
merged 10 commits into from
Oct 27, 2021
Merged

Features/clean prediction #81

merged 10 commits into from
Oct 27, 2021

Conversation

teubert
Copy link
Collaborator

@teubert teubert commented Oct 25, 2021

This is an important PR, it is a breaking change and it includes the refactoring of the format of the results of prediction. The following changes are made:

  1. Predictors are now expected to predict until every event of interest is met, or horizon is met, whichever is close. Can be specified by user, but default is all predicted events. Previously it stopped when first event is occurred
  2. EOL is returned as key:value pair of {event_name: UncertainData (Unweightedsamples for MC)}.
  3. Times is now returned as a 1d array - if an event has not occurred for a time, it is replaced with none (improving this behavior saved for Fix None behavior for end of prediction #79
  4. So times align, final state at event occurrence is no longer part of inputs, outputs, states, etc. predictions. They will be added to the EOL prediction object in Save last state in EOL #80
  5. Updated the examples that use metrics to fix break from this change

This PR includes the changes in MC to support this and a new example that predicts multiple events.

For clarity: Here are the changes the change:

Change 1: EOL format

Previous New
predict from MC returns eol as array of doubles when first event occurs. Event is not labeled and may not be the same event (i.e., for sample 1 event 1 may occur before event 2, while it could be the opposite for sample 2 predict returns UncertainData. For MC that's UnweightedSamples where each event occurring is indicated by key: value pairs
Only 1 event Any number of events
predict() -> [double] predict() -> UnweightedSamples({event_name: time, ...})

Change 2: Times

Previous New
times is in 2d array of format [sample_id][time_index] to support the non-aligned sample time steps times is 1D array of times [time_index]. Biggest source of non-aligned sample times (state at event occurrence) removed and will be added into EOL as property. If a sample doesn't exist for a time, it is indicated by None

Note

Note 1: This requires changes in the unreleased version of prog_models, so released version tests will fail

@teubert teubert merged commit 6408262 into dev Oct 27, 2021
@teubert teubert deleted the features/clean_prediction branch October 27, 2021 14:07
@teubert teubert linked an issue Oct 29, 2021 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MC - Predict any event
2 participants