<jupyter_start><jupyter_text>Example of LSTM with Single Input Sample<jupyter_code>from numpy import array
data = array([0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0])<jupyter_output><empty_output><jupyter_text>We can then use the reshape() function on the NumPy array to reshape this one-dimensional array into a three-dimensional array with 1 sample, 10 time steps, and 1 feature at each time step.<jupyter_code>data = data.reshape((1, 10, 1))
print(data.shape)
print(data)
from keras.models import Sequential
from keras.layers import Dense
from keras.layers import LSTM
single_model = Sequential()
single_model.add(LSTM(32, input_shape=(10, 1)))
single_model.add(Dense(1))<jupyter_output><empty_output><jupyter_text>Example of LSTM with Multiple Input Features<jupyter_code>import pandas as pd
import numpy as np
import keras as kr
import matplotlib.pyplot as plt
from os import listdir<jupyter_output><empty_output><jupyter_text>series 1: 0.1, 0.2, 0.3, 0.4, 0.5, 0.6, 0.7, 0.8, 0.9, 1.0series 2: 1.0, 0.9, 0.8, 0.7, 0.6, 0.5, 0.4, 0.3, 0.2, 0.1<jupyter_code>data = array([
	[0.1, 1.0],
	[0.2, 0.9],
	[0.3, 0.8],
	[0.4, 0.7],
	[0.5, 0.6],
	[0.6, 0.5],
	[0.7, 0.4],
	[0.8, 0.3],
	[0.9, 0.2],
	[1.0, 0.1]])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.1642512077294686, 'fraction_numerical': 0.09339774557165861, 'mean_word_length': 4.675799086757991, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '612891', 'license': 'OML', 'n_tokens_mistral': 601, 'n_tokens_neox': 547, 'n_words': 144, 'path': 'How to Reshape Input Data for Long Short-Term Memory Networks in Keras.ipynb', 'repo_name': 'kwrjcr/machinelearningnanodegreecapstone', 'size': '1242'}