-
-
Save ayoubbenaissa/c3064ca76208b2025a362d14dfa157f7 to your computer and use it in GitHub Desktop.
Create Ann
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
| #initialize the ANN | |
| classifier = Sequential() | |
| #add input layer and first hidden layer | |
| classifier.add(Dense(activation="relu", input_dim=11, units=6, kernel_initializer="uniform")) | |
| #add second hidden layer | |
| classifier.add(Dense(activation="relu", units=6, kernel_initializer="uniform")) | |
| #output layer: | |
| classifier.add(Dense(activation="sigmoid", units=1, kernel_initializer="uniform")) | |
| #compile ANN | |
| classifier.compile(optimizer='adam', loss='binary_crossentropy', metrics=['accuracy']) | |
| #Fitting the ANN to data | |
| classifier.fit(X_train, y_train, batch_size=10, epochs=100) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment