Home > Software design >  problem fiting my dataset into my model python
problem fiting my dataset into my model python

Time:06-03

I have a problem fitting my dataset into my model. I do not know what this error represent and surely not how to fix it. thank you!

import numpy as np
import pandas as pd
from sklearn.compose import ColumnTransformer
from sklearn.preprocessing import StandardScaler
from keras.models import Sequential
from keras.layers import Dense


dataset = pd.read_csv('Churn_Modelling.csv')
dataset

dataset desciption on Jupiter

X=dataset.iloc[:,3:13].values
Y=dataset.iloc[:,13].values

from sklearn.preprocessing import LabelEncoder, OneHotEncoder
lableencoder_X_2 = LabelEncoder()
X[:, 2] = lableencoder_X_2.fit_transform(X[:, 2])

ct = ColumnTransformer([('ohe', OneHotEncoder(), [1])], remainder='passthrough')
X = np.array(ct.fit_transform(X), dtype = str)
X = X[:, 1:]

classifier.add(Dense(units = 6,kernel_initializer = 'uniform',activation ='relu',input_dim = 11))

classifier.add(Dense(units = 6,kernel_initializer = 'uniform',activation ='relu'))

classifier.add(Dense(units= 1, kernel_initializer = 'uniform',activation = 'sigmoid'))

classifier.compile(optimizer = 'adam', loss = 'binary_crssentropy', metrics = ['accuracy'])

# fit our dataset to our module.
classifier.fit(X_train, y_train, batch_size = 10, epochs = 100)

Error: Error picture

CodePudding user response:

Well error message is pretty clear. The loss function should be binary_crossentropy not binary_crssentropy

  • Related