<jupyter_start><jupyter_text>Plotting<jupyter_code>import seaborn as sns
sns.barplot(data=df)
sns.boxplot(data=df)
plt.hist(df)
plt.hist(df['size_category'])
plt.hist(df['area'])
plt.hist(df['wind'])
plt.hist(df['temp'])
df['size_category']=pd.get_dummies(df['size_category'])
df['size_category'].value_counts()
def norm_data(i):
    x=((i-i.min())/(i.max()-i.min()))
    return x
normalized_data = norm_data(df.iloc[:,2:-1])
normalized_data
X=normalized_data
y=df['size_category']
X.head()
y.head()
from sklearn.model_selection import train_test_split
X_train,X_test,y_train,y_test=train_test_split(X,y,test_size=0.3,random_state=42)
n_features=X.shape[1]
n_features
X_train.shape,X_test.shape,y_train.shape,y_test.shape
!pip install tensorflow
import tensorflow as tf
from tensorflow import keras
import tensorflow
from tensorflow.keras import Sequential
from tensorflow.keras.optimizers import RMSprop
optmizer=RMSprop(0.001) #0.001 is a learning rate
model=keras.Sequential([
    keras.layers.Dense(12,input_dim=28,activation='relu'),
    keras.layers.Dense(50,activation='sigmoid'),
    keras.layers.Dense(1,activation='sigmoid')
])
model.compile(optimizer=optmizer,loss='binary_crossentropy',metrics=['accuracy'])
seed_val=42
import random
random.seed(seed_val)
tensorflow.random.set_seed(seed_val)
model.fit(X_train,y_train,epochs=10)
model.evaluate(X_test,y_test)
y_pred=model.predict(X_test)
y_pred[25]
y_test[192]
y_pred
#evaluating the model
scores = model.evaluate(X_test, y_test)
print("%s: %.2f%%" % (model.metrics_names[1], scores[1]*100))<jupyter_output>5/5 [==============================] - 0s 2ms/step - loss: 0.5747 - accuracy: 0.7372
accuracy: 73.72%
{'fraction_non_alphanumeric': 0.17235188509874327, 'fraction_numerical': 0.03291442250149611, 'mean_word_length': 8.393258426966293, 'pattern_counts': {'":': 0, '<': 4, '<?xml version=': 0, '>': 4, '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': '537046', 'license': 'MIT', 'n_tokens_mistral': 700, 'n_tokens_neox': 659, 'n_words': 94, 'path': 'Assignment-16- Neural Networks (Forest Fires).ipynb', 'repo_name': 'sai-kumar26/Neural-Networks', 'size': '1671'}