<jupyter_start><jupyter_text>Polynomial Features included<jupyter_code>from sklearn.preprocessing import PolynomialFeatures
poly = PolynomialFeatures(2)
new_features = poly.fit_transform(features)
x_train, x_test, y_train, y_test = train_test_split(new_features, target, test_size = 0.3)
poly.fit_transform(features).shape
model = Sequential([Dense(8, input_dim = 28, activation = 'relu'),
                    Dense(16, activation = 'relu'),
                    Dense(32, activation = 'relu'),
                    # Dense(16, activation = 'relu'),
                    # Dense(8, activation = 'relu'),
                    Dense(1, activation = 'linear')
])
model.summary()
model.compile (optimizer= 'adam', loss= 'mse', metrics= ['mae'])
history = model.fit(x_train, y_train, epochs = 100, batch_size = 32, verbose = 1, validation_split= 0.2)
plt.plot(history.history['loss'],label = 'loss')
plt.plot(history.history['val_loss'], label = 'val_loss')
plt.legend()
plt.savefig('loss_poly.png')
files.download('loss_poly.png')
plt.plot (history.history['mae'], label = 'mae')
plt.plot (history.history['val_mae'], label = 'val_mae')
plt.legend()
plt.savefig('mae_poly.png')
files.download('mae_poly.png')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.15691056910569107, 'fraction_numerical': 0.01788617886178862, 'mean_word_length': 4.399122807017544, '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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '237030', 'license': 'MIT', 'n_tokens_mistral': 443, 'n_tokens_neox': 411, 'n_words': 78, 'path': 'NeuralNetworks/Untitled0(1).ipynb', 'repo_name': 'narges8k/MachineLearningWorkshop', 'size': '1230'}