[Python] Best Approach to Handle Null Values from Different Acquisition Times

Discussão em 'Python' iniciado por Stack, Março 12, 2025.

  1. Stack

    Stack Membro Participativo

    I have a dataframe containing various vital signs (dbp, sbp, mbp, hr (heart rate), bis, exp_sev, insp_sev (inspired/expired sevolfurane) collected over time for multiple patients. The acquisition times for these signals vary, resulting in null values at different intervals:

    • bis is acquired every second, so it has very few null values.
    • dbp, sbp, and mbp are acquired every 2 seconds, resulting in null values every other second.
    • exp_sev and insp_sev are acquired every 7 seconds, resulting in null values every 7 seconds. Given this scenario, I am looking for the best approach to handle these null values, considering I want to run both linear regression and LSTM models on the data (in python).

    Questions:

    • Should I impute the null values, and if so, what method would be most appropriate (e.g., interpolation, forward fill, backward fill)?
    • Is it better to leave the null values as they are since the test set will also have them?

    Additional Information: The data is in a time series format, and each row corresponds to one second in time. I want to preserve the temporal integrity and relationships between the different vital signs. Any insights or recommendations would be greatly appreciated!

    Continue reading...

Compartilhe esta Página