I have the following problem: I have a set of time-stamped articles and labels for particular instants of time. I want to train a neural network to learn which articles to take in as input (according to the time frame, e.g., only consider articles that came <=5 hours before the label's time instant). This would also mean that the network should be able to deal with various inputs. Is this possible to do?

My specific use case is: I have a set of news articles, each represented by a vector. For each of these, I also have a time stamp. The label (i.e., whether the stock price falls or rises) is known to me for certain time instants. Let's say I want to look at t=3,5,8. Then at t=3, I will want to look at articles published before that in a certain time frame of h hours. Instead of me deciding the h, I like the model to be able to learn this value using the three examples I gave it and then use this value to predict labels for some new data (i.e., news articles)

I was thinking of creating the most extensive set of inputs and letting the model assign weights to each input in this set. A small or 0 weight would automatically mean that the network is not worried about these inputs. Is there a better way to approach this? Are there any related resources?

  • $\begingroup$ Could you describe your data more explicitly? Maybe give some example input vectors an example outputs. $\endgroup$ Sep 18, 2021 at 21:08
  • $\begingroup$ @MachineLearner done, please see if this clarifies the question $\endgroup$
    – huy
    Sep 19, 2021 at 3:00
  • $\begingroup$ NNs with variable number of inputs has been asked before. One solution is to always have the maximum.number of inputs and simply use dummy inputs when actual inputs are less than those. $\endgroup$
    – Nikos M.
    Sep 20, 2022 at 19:05


Your Answer

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