I am working on research, where need to classify one of three event WINNER=(win
, draw
, lose
)
WINNER LEAGUE HOME AWAY MATCH_HOME MATCH_DRAW MATCH_AWAY MATCH_U2_50 MATCH_O2_50
3 13 550 571 1.86 3.34 4.23 1.66 2.11
3 7 322 334 7.55 4.1 1.4 2.17 1.61
My current model is:
def build_model(input_dim, output_classes):
model = Sequential()
model.add(Dense(input_dim=input_dim, output_dim=12, activation=relu))
model.add(Dropout(0.5))
model.add(Dense(output_dim=output_classes, activation='softmax'))
model.compile(loss='categorical_crossentropy', optimizer='adadelta')
return model
- I am not sure that is the correct one for multi-class classification
- What is the best setup for binary classification?
EDIT: #2 - Like that?
model.add(Dense(input_dim=input_dim, output_dim=12, activation='sigmoid'))
model.add(Dropout(0.5))
model.add(Dense(output_dim=output_classes, activation='softmax'))
model.compile(loss='binary_crossentropy', optimizer='adadelta')
activation='softmax'
and compile choice ofloss='categorical_crossentropy'
? IMO, your choices for those are good for a model to predict multiple mutually-exclusive classes. If you want advice on the whole model, that is quite different, and you should explain more about what your concerns are, otherwise there is too much to explain in a single answer. – Neil Slater Feb 01 '16 at 16:09architecture
of layers mostly. Any advise for my question #2? – SpanishBoy Feb 01 '16 at 16:29activation='sigmoid'
andloss='binary_crossentropy'
– Neil Slater Feb 01 '16 at 16:33activation='sigmoid'
in the output layer. The hidden layer can stay as'relu'
if you like (although I would probably start with'tanh'
for this problem, that is personal preference with very little support from theory) – Neil Slater Feb 01 '16 at 16:38