<p>There are several techniques which can be applied using feature engineering. Two possible examples are:</p>
<ol>
<li><p>You may reduce the dimensionality by summarizing the single features by i.e. applying the mean, median, max, min etc..</p>
</li>
<li><p>Assuming the dimnensionality of the <code>time_dep_feature</code> does not change: You could &quot;unfold&quot; the features by just declaring a &quot;normal&quot; feature for every entry in the dictionary.</p>
</li>
</ol>
<p>moreover there are also specific algorithms which may help you reducing the dimensionality of a specific feature while keeping as much information as possible, you may refer to <a href="https://arxiv.org/pdf/1403.2877.pdf" rel="nofollow noreferrer">https://arxiv.org/pdf/1403.2877.pdf</a></p>
<p>In particular, you have to test in which way your model predicts best.</p>
How does one store multidimensional features?
<p>Most textbook examples of machine learning applications use a 2D <a href="https://en.wikipedia.org/wiki/Design_matrix" rel="nofollow noreferrer">design matrix</a> to store the training data. E.g., the <a href="https://scikit-learn.org/stable/auto_examples/datasets/plot_iris_dataset.html" rel="nofollow noreferrer">iris dataset</a> is the assembly of four, single-valued, numerical features. But what if one of the features is a time series, i.e., a timestamped series of numerical features? One could store each of those feature values in a dictionary where the keys are the timestamps,</p>
<pre><code>time_dep_feature = {'20200103 08:20:04': 5, '20200103 16:54:10': 2, '20200215 14:31:16': 7, ···}
</code></pre>
<p>The problem then is that the rest of the design matrix is 2D, whereas <code>time_dep_feature</code> rises up in the third dimension. The dictionary solution above is easily readable by Python, but is nonetheless cumbersome, especially if one wants to use the power of scalable solutions such as <code>tf.data.Dataset</code>. (The latter does allow for N-dimensional design matrices/tensors, but it isn't clear how it keeps track of the timestamp indices within the <code>time_dep_feature</code> column.)</p>
<p>What is the state of the art for nesting structured data of this sort? Clearly there must exist something more elaborate than storing Python-readable strings as the dictionary example above.</p>
<p>PS: TensorFlow's <a href="https://www.tensorflow.org/guide/ragged_tensor" rel="nofollow noreferrer"><code>tf.RaggedTensor</code></a> seems to be the closest thing to a solution, but the problem is that I don't quite know how to store the time stamps since it does not ingest dictionaries.</p>