1
$\begingroup$

I'm new to machine learning and I'm trying to work on a problem and the data looks like the following:

Date/Time            Tchg   Tcold   Pchg    Qchg    Flow    CUF  dCUF
1999-07-20 00:00:00 479.606 550.187 1238.22 94.1212 0.0 0.00492  0.00001
1999-07-21 10:20:00 480.169 550.187 2238.22 94.3004 0.0 0.00492  0
1999-07-21 00:00:00 479.606 550.187 1238.22 94.1212 0.0 0.00496  0.00004
1999-07-22 00:17:42 279.606 550.187 1238.22 94.1212 0.0 0.00496  0
1999-07-22 03:43:03 279.606 550.187 1238.22 94.1212 1.0 0.00496  0
1999-07-22 00:00:00 279.606 350.187 2238.22 94.1212 1.0 0.00497 10.000011
  1. The data set has 6 columns with 5 of them will be input and CUF to be predicted. The dCUF is just the change of CUF from previous row.
  2. During each day the 5 inputs will be collected from sensor for several times and each time they may change. Based on the each collected data, CUF may change but it's only updated at the end of the day.
  3. Each row input actually may create a change of CUF from previous row (time history) but it's not shown.

I'm thinking of combining the input for each day which is an array of n x 5 (n depends on how many times the input data are collected and is not fixed) and then try to predict the dCUF which is the change of CUF for each day.

My questions are:

  1. Will this be predictable since we don't have correct CUF at each collected time?
  2. If this is predictable, what kind of data manipulation should I do and what model should I use?
$\endgroup$
1

2 Answers 2

1
$\begingroup$

I assume the 5 columns are parameters for CUF then there should be a mathematical formula or model for CUF. Anyway since there is a variation in data you need Time-Series data prediction and I think the only way to do it is to build neural network model that you can train and has five inputs (Tchg,Tcold,Pchg,Qchg..) and CUF as output layer. Tensorflow and pytorch are all good starting point for building CNN check here:

https://www.tensorflow.org/api_docs/python/tf/keras/layers/Conv1D

and also hybrid approach (quasi-recurrent neural networks, QRNN) as discussed by Bradbury et al (2016) https://arxiv.org/abs/1611.01576

$\endgroup$
0
1
$\begingroup$
  1. If CUF is your objective variable, and it is not measured correctly, there is no way to have an ML model that predicts the right value, if the right value is not known.

  2. Time series forecasting using multi-input variables is normally addressed using RNN models like LSTM or CNN, check this tensorflow tutorial.

As for the preprocessing, a good rule of thumb is batch normalization when dealing with neural networks, others techniques, highly depends on the problem.

$\endgroup$
7
  • $\begingroup$ Hi jcaliz, Is it possible to use the whole day input of an array of n x 5 as I mentioned and then try to predict the change of CUF? That way we know the history of the input change and just try to predict one variable dCUF. Is there any model that can take this kind of data with X being a vector of arrays and y being another vector? Thanks! $\endgroup$
    – Jian w
    Commented Apr 12, 2021 at 17:07
  • $\begingroup$ With LSTM you can use an input of n x 5 to predict the n+1 CUF value. $\endgroup$
    – jcaliz
    Commented Apr 12, 2021 at 17:11
  • $\begingroup$ Sorry, I think I didn't describe correctly. What I want is I have m days of input and m CUF (Remember the CUF is only updated once a day). For each days the input will be an array of n x 5 (n may be different for each day). Will LSTM handle this kind of input? Do you know any example of reference I can learn for this? Thanks! $\endgroup$
    – Jian w
    Commented Apr 12, 2021 at 18:57
  • $\begingroup$ You can have m days of inputs to predict k days of CUF however if m is variable, you might have to deal with filling techniques like padding. The tutorial I sent, has an example where you use 23 days and 5 variables to predict the 24th day. $\endgroup$
    – jcaliz
    Commented Apr 12, 2021 at 20:12
  • $\begingroup$ Hi jcaliz, I'm trying to follow the tutorial which is great! However, how can I convert the predicted value and compared to the original one? I tried to use the labels* train_std+train_mean but it seems not working. $\endgroup$
    – Jian w
    Commented Apr 19, 2021 at 13:18

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.