<jupyter_start><jupyter_text><jupyter_code>len(lf_df)
lf_df.head()
# make features from dataset
# input shape (batch_size, window_size, n_features)
# ouput shape (batch_size, n_classes)

# if trade price[current+5] = trade price[current] ... 0
#    trade price[current+5] < trade price[current] ... 1
#    trade price[current+5] > trade price[current] ... 2
data = data_prep.get_test_data(window_size=10, predict_step=5, filename=FILENAME)
print(data.x.shape[1:])
from nn import NeuralNetwork
from rnn import RNN

n_cross_validation = 3

# input_shape <- (timestep, n_features)
# output_shape <- n_classes
nn = NeuralNetwork(RNN(input_shape=data.x.shape[1:], output_dim=data.y.shape[1]), class_weight= {0:1., 1:1., 2:1.})

print("TRAIN")
nn.train(data)

print("TEST")
nn.test(data)

#print("TRAIN WITH CROSS-VALIDATION")
#nn.run_with_cross_validation(data, n_cross_validation)<jupyter_output>Build model...
Compile model.   ..
TRAIN
Train...
before fit
WARNING:tensorflow:From C:\Users\rohit\Anaconda3\lib\site-packages\tensorflow\python\ops\math_grad.py:1250: add_dispatch_support.<locals>.wrapper (from tensorflow.python.ops.array_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.where in 2.0, which has the same broadcast rule as np.where
Train on 1485 samples, validate on 496 samples
Epoch 1/2
1485/1485 [==============================] - 2s 1ms/step - loss: 0.9955 - acc: 0.5185 - val_loss: 0.7261 - val_acc: 0.7823

Epoch 00001: val_acc improved from -inf to 0.78226, saving model to ./model/improvement-01-0.78.hdf5
Epoch 2/2
1485/1485 [==============================] - 0s 109us/step - loss: 0.5644 - acc: 0.8512 - val_loss: 0.7436 - val_acc: 0.7823

Epoch 00002: val_acc did not improve from 0.78226
EACH : class 0: 1.0, class 1: 0.0, class 2: 0.0
PREDICTED: class 0: 1652, class 1: 0, class 2: 0
ACTUAL: class 0: 1652, class 1: 131, cla[...]
{'fraction_non_alphanumeric': 0.16236162361623616, 'fraction_numerical': 0.08118081180811808, 'mean_word_length': 4.751515151515152, 'pattern_counts': {'":': 0, '<': 8, '<?xml version=': 0, '>': 6, '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': '427957', 'license': 'MIT', 'n_tokens_mistral': 811, 'n_tokens_neox': 695, 'n_words': 186, 'path': 'tasks/time-series/time-series-prediction/.ipynb_checkpoints/nn_example-checkpoint.ipynb', 'repo_name': 'rohitranjan1994/ai-platform', 'size': '1897'}