So, this is the next part of my previous tutorial Tutorial: A quick overview of tensorflow2.0. In the previous tutorial, we learned about all the basics of tensorflow2.0 and different types of Keras API.
Check it out! If you haven’t yet! The link is above.
So let’s get started with a detailed analysis of Sequential API in Keras tensorflow2.0. Here, We are going to predict on Titanic dataset with the help of Sequential API. You can download the dataset from here. and follow along with me in this.
As I have told you before. My preferred way to run tensorflow2.0 is Google Colab. It provides us CPU/ GPU/ TPU support. In Google Colab, directly import the TensorFlow and it will return you the latest version. Keras runs tensorflow2.0 as a backend.
I will show how to download any Kaggle dataset directly into Google Colab in my next tutorial. (Link will be edited/updated here.)
## Import Basic Libraries
import numpy as np ## numerical data processing
import pandas as pd ## data processing, CSV file I/O
## This will be some files of titanic dataset downloaded from kaggle
titanic/train.csv
titanic/gender_submission.csv
titanic/test.csv
Let’s import the required TensorFlow libraries.
## Sklearn.preprocessing module for preprocessing of data
from sklearn import preprocessing
## Import Keras from tensorflow backend
from tensorflow.python import keras
## SimpleImputer for filling missing values
from sklearn.impute import SimpleImputer
## Import tensorflow
import tensorflow as tf
## Import Sequential class (i.e for putting it together)
from tensorflow.python.keras.models import Sequential
## Import different layers from Layer class
from tensorflow.python.keras.layers import Dense, Dropout
#kaggle #keras #tensorflow #machine-learning #deep-learning #deep learning