<jupyter_start><jupyter_text>Now use Keras2DML importer<jupyter_code>from systemml.mllearn import Keras2DML


epochs = 50
batch_size = 50
max_iter = int(epochs * math.ceil(samples / batch_size))
model = Keras2DML(
    spark,
    model,
    input_shape=(timesteps, dim, 1),
    batch_size=batch_size,
    max_iter=max_iter,
    test_interval=0,
    display=10,
)
model.set(perform_one_hot_encoding=False)
model.set(debug=True)
def train(data):
    data = data.reshape(samples, timesteps * dim)
    model.fit(
        data, data
    )  # epochs=50, batch_size=72, validation_data=(data, data), verbose=0, shuffle=False,callbacks=[LossHistory()])
train(data_healthy_scaled)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11857142857142858, 'fraction_numerical': 0.022857142857142857, 'mean_word_length': 5.20353982300885, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '89435', 'license': 'MIT', 'n_tokens_mistral': 276, 'n_tokens_neox': 262, 'n_words': 44, 'path': 'applied-ai-apach-system-ml-and-dl4j/Parallel/Watson IoT Platform Keras and SystemML LSTM model.ipynb', 'repo_name': 'Code360In/spark-code-examples', 'size': '700'}