This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
impute=titanic.pivot_table(values=['Age'],index=['Sex','Survived'],aggfunc=np.mean) | |
impute | |
for i in range(len(titanic)): | |
if np.isnan(titanic.Age[i]): | |
if (titanic.Sex[i]=='female') & (titanic.Survived[i]==0): | |
titanic.Age[i]=25.04 | |
for i in range(len(titanic)): | |
if np.isnan(titanic.Age[i]): | |
if (titanic.Sex[i]=='female') & (titanic.Survived[i]==1): | |
titanic.Age[i]=28.84 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
""" | |
Created on Sun Dec 10 22:55:00 2017 | |
@author: Ashok | |
""" | |
# Importing the Keras libraries and packages | |
from keras.models import Sequential | |
from keras.layers import Convolution2D |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Importing the libraries | |
import numpy as np | |
import matplotlib.pyplot as plt | |
import pandas as pd | |
# Importing the dataset | |
dataset = pd.read_csv('Churn_Modelling.csv') | |
# Encoding categorical data | |
from sklearn.preprocessing import LabelEncoder, OneHotEncoder | |
labelencoder_X_1 = LabelEncoder() |