Experiment 2 FDL - Jupyter Notebook
Experiment 2 FDL - Jupyter Notebook
value_counts ()
In [4]: df=pd .read_csv ("Churn_Modelling.csv" ) In [15]: df = pd.get_dummies ( df, columns =['Geography','Gender' ], prefix=[ 'Geography' ,
df.head () 'Gender' ],drop_first = False , dtype = int)
RowNumber CustomerId Surname CreditScore Geography Gender Age Tenure Balance Nu In [16]: X = df.drop (columns= ['Exited' ], axis = 1)
y = df['Exited' ]
0 1 15634602 Hargrave 619 France Female 42.0 2 0.00
Out[4]:
1 2 15647311 Hill 608 Spain Female 41.0 1 83807.86 In [17]: from sklearn .model_selection import train_test_split
2 3 15619304 Onio 502 France Female 42.0 8 159660.80 X_train ,X_test ,y_train ,y_test = train_test_split (X,y,test_size =0.2 ,random_state =4
In [6]: df.info ()
Epoch 1/10
Out[7]: 2
251/251 [==============================] - 0s 2ms/step - loss: nan - accuracy:
0.7955
Epoch 2/10
251/251 [==============================] - 0s 1ms/step - loss: nan - accuracy:
0.7955
Epoch 3/10
251/251 [==============================] - 0s 1ms/step - loss: nan - accuracy:
0.7955
Epoch 4/10
251/251 [==============================] - 0s 2ms/step - loss: nan - accuracy:
0.7955
Epoch 5/10
251/251 [==============================] - 0s 2ms/step - loss: nan - accuracy:
In [35]: import tensorflow from tensorflow import
0.7955
keras from tensorflow.keras import
Epoch 6/10
Sequential from tensorflow.keras.layers
251/251 [==============================] - 0s 1ms/step - loss: nan - accuracy:
import Dense model = Sequential()
0.7955
model.add(Dense(units=3, activation='sigmoid', input_dim = 13))
Epoch 7/10
model.add(Dense(units=1, activation='sigmoid')) model.summary()
251/251 [==============================] - 0s 1ms/step - loss: nan - accuracy:
Model: "sequential_3" 0.7955
_________________________________________________________________ Epoch 8/10
Layer (type) Output Shape Param # 251/251 [==============================] - 0s 2ms/step - loss: nan - accuracy:
================================================================= 0.7955
dense_6 (Dense) (None, 3) 42 Epoch 9/10
dense_7 (Dense) (None, 1) 4 251/251 [==============================] - 0s 2ms/step - loss: nan - accuracy:
================================================================= 0.7955
Total params: 46 (184.00 Byte) Epoch 10/10
Trainable params: 46 (184.00 Byte) 251/251 [==============================] - 0s 2ms/step - loss: nan - accuracy:
Non-trainable params: 0 (0.00 Byte) 0.7955
_________________________________________________________________
Out[38]: <keras.src.callbacks.History at 0x2cd0e2a99c0>
Out[44]: 0.7991004497751124
C:\Users\Harleen
Manmeet\AppData\Local\Programs\Python\Python310\lib\site-packag
es\sklearn\metrics\_classification.py:1344:
UndefinedMetricWarning: Precision an d F-score are ill-defined
and being set to 0.0 in labels with no predicted sampl es. Use
`zero_division` parameter to control this behavior.
_warn_prf(average, modifier, msg_start, len(result))
C:\Users\Harleen
Manmeet\AppData\Local\Programs\Python\Python310\lib\site-packag
es\sklearn\metrics\_classification.py:1344:
UndefinedMetricWarning: Precision an d F-score are ill-defined
and being set to 0.0 in labels with no predicted sampl es. Use
`zero_division` parameter to control this behavior.
_warn_prf(average, modifier, msg_start, len(result))
In [ ]: