I am new to tensorflow I was trying to build a simple model that would output the probability of installation (install colum).
Here a subset of the dataset:
{'A': {0: 12, 2: 28, 3: 26, 4: 9, 5: 36},
'B': {0: 10, 2: 17, 3: 22, 4: 2, 5: 31},
'C': {0: 1, 2: 0, 3: 5, 4: 0, 5: 1},
'D': {0: 5, 2: 0, 3: 0, 4: 0, 5: 0},
'E': {0: 12, 2: 1, 3: 4, 4: 3, 5: 1},
'F': {0: 12, 2: 2, 3: 14, 4: 9, 5: 11},
'install': {0: 0, 2: 0, 3: 1, 4: 0, 5: 0},
'G': {0: 21, 2: 12, 3: 8, 4: 13, 5: 19},
'H': {0: 0, 2: 5, 3: 1, 4: 6, 5: 5},
'I': {0: 21, 2: 22, 3: 5, 4: 10, 5: 20},
'J': {0: 0.0, 2: 136.5, 3: 0.0, 4: 0.1, 5: 29.5},
'K': {0: 0.15220949263502456,
2: 0.08139534883720931,
3: 0.15625,
4: 0.15384584755440725,
5: 0.04188829787234043},
'L': {0: 649, 2: 379, 3: 531, 4: 660, 5: 242},
'M': {0: 0, 2: 0, 3: 0, 4: 1, 5: 1},
'N': {0: 1, 2: 1, 3: 1, 4: 0, 5: 0},
'O': {0: 0, 2: 1, 3: 0, 4: 1, 5: 0},
'P': {0: 0, 2: 0, 3: 0, 4: 0, 5: 0},
'Q': {0: 1, 2: 0, 3: 1, 4: 0, 5: 1}}
And here the code I was working on:
X = df.drop('install', axis=1) #data
y = df['install'] #target
X_train, X_test, y_train, y_test = train_test_split(X, y, random_state = 42, test_size = 0.3)
X_train = ss.fit_transform(X_train)
X_test = ss.fit_transform(X_test)
model = keras.models.Sequential([
keras.layers.Flatten(),
keras.layers.Dense(128, activation='softmax'),
keras.layers.Dropout(0.2),
keras.layers.Dense(10)
])
loss = keras.losses.BinaryCrossentropy(from_logits=True)
optim = keras.optimizers.Adam(lr=0.001)
metrics = ["accuracy"]
model.compile(loss=loss, optimizer=optim, metrics=metrics)
batch_size = 32
epoch = 5
model.fit(X_train, y_train, batch_size=batch_size, epochs=epoch, shuffle=True, verbose=1)
Could you help me in understanding the error? I understood that the problem is about the size of my X and y.