我正在研究,需要对三个事件之一进行分类 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
我现在的模型是:
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
- 我不确定这是多类分类的正确方法
- 二进制分类的最佳设置是什么?
编辑:#2 - 像那样?
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')