Implementing Artificial Neural Network in Python From Scratch
Implementing Artificial Neural Network in Python From Scratch
27 3
Pre-Requisites for Artificial Neural
Network Implementation
Following will be the libraries and software that we will be
needing in order to implement ANN.
Structure of dataset
As we can see from the above data dictionary, we are
dealing with a total of 14 dimensions.
Here our main goal is to create an artificial neural network
that will take into consideration all independent
variables(first 13) and based on that will predict if our
customer is going to exit the bank or not(Exited is
dependent variable here).
Once we understand the steps for constructing neural
networks, we can directly implement those same steps to
other datasets as well.
One of the ways where we can find such datasets is the
UCI machine learning repository. These datasets are
classified into regression and classification problems.
Since we are implementing this neural network to solve
classification problems, you can download any
classification dataset from there and can apply the same
steps on any dataset of your choice !. How cool is that?
Importing Necessary Libraries for Artificial
Neural Network
Let’s import all the necessary libraries here
#Importing necessary Libraries
import numpy as np
import pandas as pd
import tensorflow as tf
Importing Dataset
In this step, we are going to import our dataset. Since our
dataset is in csv format, we are going to use the
read_csv() method of pandas in order to load the dataset.
#Loading Dataset
data = pd.read_csv("Churn_Modelling.csv")
Output:
[[False]]
That’s it. Using this one line of code allows us to save our
ML model. You might have a query here?
What is the h5 file format? Well, h5 is a specific file format
used by neural networks. Using this format we can
directly save our neural network as a serialized object. It
is similar to the pickle file format implementation that we
use for storing traditional machine learning models.
Well, that’s all about implementing neural networks from
scratch in Python.
If you’re an enthusiast who is looking forward to unravel
the world of Generative AI. Then, please register for our
upcoming event, DataHack Summit 2023.
Conclusion
Hope you like this article.
https://www.linkedin.com/in/shrish-mohadarkar-060209109/
Shrish Mohadarkar
14 Aug 2023
Submit reply
Elizabeth Giuliano
23 May, 2022
thank you thank you thank you!!
chan
22 Oct, 2023
Company Discover
About Us Blogs
Contact Us Expert session
Careers Podcasts
Comprehensive Guides
Learn Engage
Free courses Community
Learning path Hackathons
BlackBelt program Events
Gen AI Daily challenges
Contribute Enterprise
Contribute & win Our offerings
Become a speaker Case studies
Become a mentor Industry report
Become an instructor quexto.ai
Download App