Skip to content

Instantly share code, notes, and snippets.

@abhi1868sharma
Created December 16, 2019 11:35
Show Gist options
  • Select an option

  • Save abhi1868sharma/a022d857cdcddff702db95b2c903c611 to your computer and use it in GitHub Desktop.

Select an option

Save abhi1868sharma/a022d857cdcddff702db95b2c903c611 to your computer and use it in GitHub Desktop.
model = xDeepFM(linear_feature_columns, dnn_feature_columns, dnn_hidden_units=(256, 256),\
cin_layer_size=(128, 128), \
cin_split_half=True, cin_activation='relu'\
,l2_reg_linear=1e-05,\
l2_reg_embedding=1e-05, l2_reg_dnn=0, l2_reg_cin=0, \
init_std=0.0001,seed=1024, dnn_dropout=0,dnn_activation='relu', \
dnn_use_bn=False, task='binary')
#compiling the model
model.compile("adam", "binary_crossentropy",metrics=['binary_crossentropy'], )
# training the model
history = model.fit(train_model_input, train[target].values,
batch_size=256, epochs=10, verbose=2, validation_split=0.2, )
#predicting
pred_ans_xdeep = model.predict(test_model_input, batch_size=256)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment