# How to adapt the LSTM neural network example with sea temperature data to a different dataset?

**URL:** <https://community.konduit.ai/t/how-to-adapt-the-lstm-neural-network-example-with-sea-temperature-data-to-a-different-dataset/2378>\
**Category:** DL4J\
**Created:** [March 19, 2023, 9:17pm UTC](https://community.konduit.ai/t/how-to-adapt-the-lstm-neural-network-example-with-sea-temperature-data-to-a-different-dataset/2378 "2023-03-19T21:17:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![LeandroZanatta](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@LeandroZanatta](https://community.konduit.ai/u/LeandroZanatta)\
**Post date:** [March 19, 2023, 9:17pm UTC](https://community.konduit.ai/t/how-to-adapt-the-lstm-neural-network-example-with-sea-temperature-data-to-a-different-dataset/2378/1 "2023-03-19T21:17:54Z")

</div>

In the example [https://deeplearning4j.konduit.ai/v/en-1.0.0-beta7/getting-started/tutorials/sea-temperature-convolutional-lstm](https://deeplearning4j.konduit.ai/v/en-1.0.0-beta7/getting-started/tutorials/sea-temperature-convolutional-lstm), without detailed information on how the data was processed and transformed into a suitable input format for the neural network model, the example is less useful for those who want to adapt it to a different dataset. This can make it difficult to understand and implement the model for other use cases. It would be useful to have more detailed information on the data preprocessing and transformation process so that we can better understand how the input data should be formatted for the neural network model.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [March 19, 2023, 9:25pm UTC](https://community.konduit.ai/t/how-to-adapt-the-lstm-neural-network-example-with-sea-temperature-data-to-a-different-dataset/2378/2 "2023-03-19T21:25:28Z")

</div>

@LeandroZanatta Could you clarify what you’re looking for?

Before I start, I want you to know that M2.1 is the latest version and beta7 is 2 years old at this point. We’ve removed a lot of those examples from newer versions for that exact reason.

For example, if there were things like normalizations it would be specified.

Are you talking about the raw csv data itself and how it gets converted to a neural network?

If you’re looking for an overview of each class or something look on the class itself:

> <https://github.com/deeplearning4j/deeplearning4j/blob/4766032444de8e0c2c3389270576bb6e7c466211/deeplearning4j/deeplearning4j-data/deeplearning4j-datavec-iterators/src/main/java/org/deeplearning4j/datasets/datavec/SequenceRecordReaderDataSetIterator.java#L47>

If you’re curious about say: the record reader you (or any other class) a good trick is to also check the tests:

> **[Search · CSVSequenceRecordReader · deeplearning4j/deeplearning4j](https://github.com/deeplearning4j/deeplearning4j/search?q=CSVSequenceRecordReader)**
>
> Suite of tools for deploying and training deep learning models using the JVM. Highlights include model import for keras, tensorflow, and onnx/pytorch, a modular and tiny c++ library for running mat...

Happy to help please do narrow down what you’re looking for.

---

<div class="post-metadata">

**Author:** ![LeandroZanatta](https://avatars.discourse-cdn.com/v4/letter/l/f08c70/32.png) [@LeandroZanatta](https://community.konduit.ai/u/LeandroZanatta)\
**Post date:** [March 20, 2023, 1:52pm UTC](https://community.konduit.ai/t/how-to-adapt-the-lstm-neural-network-example-with-sea-temperature-data-to-a-different-dataset/2378/3 "2023-03-20T13:52:31Z")

</div>

> [@agibsonccc](#):
>
> os próprios dados csv brutos e como eles são convertidos em uma rede neural?

My doubt is how the raw data was converted into the csv files.  
In the case itself, my question is more related to how the data was organized into 52 inputs. It only states that data from 8 seas was used and organized into 2 dimensions. But what do the 2 dimensions refer to? Seas and characteristics of each sea? Time and characteristics of each period? I’m more interested in knowing why it was done this way than how it was done. I had this doubt when reading this tutorial, and I believe that this could contribute to a deeper understanding of the example.

---

<div class="post-metadata">

**Author:** ![agibsonccc](https://yyz1.discourse-cdn.com/flex035/user_avatar/community.konduit.ai/agibsonccc/32/697_2.png) [@agibsonccc](https://community.konduit.ai/u/agibsonccc)\
**Post date:** [March 20, 2023, 10:09pm UTC](https://community.konduit.ai/t/how-to-adapt-the-lstm-neural-network-example-with-sea-temperature-data-to-a-different-dataset/2378/4 "2023-03-20T22:09:08Z")

</div>

> [@LeandroZanatta](#):
>
> tion is more related to how the data was organized into 52 inputs. It only states that data from 8 seas was used and organized into 2 dimensions. But what do the 2 dimensions refer to?
> 
> It’s mentioned that it’s a geospatial grid. (latitude/longitude)
> 
> Seas and characteristics of each sea? Time and characteristics of each period? I’m more interested in knowing why it

@LeandroZanatta it it helps the dataset itself is fairly generic. This just forecasts future values of the given inputs. This is setup as a regression problem. The original tutorial is here:

> **[Convolutional LSTM for ocean temperature with Deeplearning4j](https://devm.io/machine-learning/convolutional-lstm-deeplearning4j-146157-001)**
>
> Thanks to their flexible nature, neural networks and deep learning have transformed data science. Briton Park explains how to forecast oceanic temperatures by designing, training, and evaluating a neural network model with Eclipse Deeplearning4j....

I’d argue that the given tutorial is fairly generic and does set you up for a regression problem.

Just know that each time step as a row in the CSV file, with the time column as the first column, feature columns as input columns.

If we were to rewrite this (again this is a fairly old tutorial but still works)

a simpler problem would probably be more suitable (eg: stocks)

Would that be ok? The issue with regression problems is you can either try to forecast a completely independent variable or the future state of the inputs.
