Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to get multi output for DeepFM? #499

Open
jonathonbird opened this issue Nov 4, 2022 · 1 comment
Open

How to get multi output for DeepFM? #499

jonathonbird opened this issue Nov 4, 2022 · 1 comment
Labels

Comments

@jonathonbird
Copy link

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

@Anaizii
Copy link

Anaizii commented Mar 28, 2023

hi,did you slove this problem? I face the same question recently.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants