Skip to content

How to get multi output for DeepFM? #499

Description

@jonathonbird

I'm trying to use DeepFM to predict scores for the world cup, which has 2 outputs the [left score, right score]. For the y values, the model takes in a (35245, 2) shape, and runs, but only gives one value for the output.
Basically I'm asking how to set the amount of nodes in the output layer to 2 instead of 1.

Y_train looks like this:

   home_score  away_score
         0.0         1.0
         1.0         1.0
         0.0         1.0
         1.0         2.0

The model is:

 model = DeepFM(linear_feature_columns,dnn_feature_columns,task='regression')
 model.compile("adam", "mean_squared_error",
               metrics=['mean_squared_error'], )
history = model.fit(train_model_input, Y_train.values,
                    batch_size=256, epochs=10, verbose=2, validation_split=0.2, )
pred_ans = model.predict(test_model_input, batch_size=256)

Using google colab

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions