conclusions rememberto perform binary classificationend your stack of layers with dense layer with single unit and sigmoid activationand use binary_crossentropy as the loss your targets should be either or from keras import models from keras import layers model models sequential(model add(layers dense( activation='relu'input_shape=(num_input_features,))model add(layers dense( activation='relu')model add(layers dense( activation='sigmoid')model compile(optimizer='rmsprop'loss='binary_crossentropy'to perform single-label categorical classification (where each sample has exactly one classno more)end your stack of layers with dense layer with number of units equal to the number of classesand softmax activation if your targets are one-hot encodeduse categorical_crossentropy as the lossif they're integersuse sparse_categorical_ crossentropymodel models sequential(model add(layers dense( activation='relu'input_shape=(num_input_features,))model add(layers dense( activation='relu')model add(layers dense(num_classesactivation='softmax')model compile(optimizer='rmsprop'loss='categorical_crossentropy'to perform multilabel categorical classification (where each sample can have several classes)end your stack of layers with dense layer with number of units equal to the number of classes and sigmoid activationand use binary_crossentropy as the loss your targets should be -hot encodedmodel models sequential(model add(layers dense( activation='relu'input_shape=(num_input_features,))model add(layers dense( activation='relu')model add(layers dense(num_classesactivation='sigmoid')model compile(optimizer='rmsprop'loss='binary_crossentropy'to perform regression toward vector of continuous valuesend your stack of layers with dense layer with number of units equal to the number of values you're trying to predict (often single onesuch as the price of house)and no activation several losses can be used for regressionmost commonly mean_squared_error (mseand mean_absolute_error (mae)model models sequential(model add(layers dense( activation='relu'input_shape=(num_input_features,))model add(layers dense( activation='relu')model add(layers dense(num_values)model compile(optimizer='rmsprop'loss='mse'licensed to