You are on page 1of 2

Ctrl + M for making heading

# import the neccassry libraries and mount the drive first

import pandas as pd

import numpy as np

import tensorflow as tf

from tensorflow import keras

import matplotlib.pyplot as plt

from keras.models import Sequential

from tensorflow.keras import layers

from sklearn.metrics import mean_absolute_error

from sklearn.metrics import mean_squared_error

from sklearn.preprocessing import StandardScaler

from sklearn.model_selection import train_test_split

from google.colab import drive

from sklearn import preprocessing

drive.mount('/content/drive')

Shift + Enter

for cell execution

X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.3,


random_state=42)

Here,

X_train: is Input for Training Set (Total Data of Training Set)


X_test: is input for Test Set

y_train: is Label for Training Set

y_test: is Label for Test Set

# Add a Flatten layer to flatten the input data


model.add(layers.Flatten(input_shape=(13, 1)))
Flatten layer make these 13 dimensions () into Column Vector

# Add one or more Dense layers


model.add(layers.Dense(64, activation='relu'))
Dense means every member of the previous layer (Every member of column
Vector is connected with 64 neurons.

# You can add more hidden layers if needed


model.add(layers.Dense(32, activation='relu'))
Above 64 neurons are connected to every member of the 32 neurons.

# Add the output layer with a single neuron and sigmoid activation for
binary classification
model.add(layers.Dense(1, activation='sigmoid'))
Above 32 neurons are connected to only one neuron.

You might also like