Classification and regression in one model
Now you will create a different kind of 2-output model. This time, you will predict the score difference, instead of both team's scores and then you will predict the probability that team 1 won the game. This is a pretty cool model: it is going to do both classification and regression!
In this model, turn off the bias, or intercept for each layer. Your inputs (seed difference and predicted score difference) have a mean of very close to zero, and your outputs both have means that are close to zero, so your model shouldn't need the bias term to fit the data well.
This exercise is part of the course
Advanced Deep Learning with Keras
Exercise instructions
- Create a single input layer with 2 columns.
- The first output layer should have 1 unit with
'linear'
activation and no bias term. - The second output layer should have 1 unit with
'sigmoid'
activation and no bias term. Also, use the first output layer as an input to this layer. - Create a model with these input and outputs.
Hands-on interactive exercise
Have a go at this exercise by completing this sample code.
# Create an input layer with 2 columns
input_tensor = ____
# Create the first output
output_tensor_1 = ____(____, activation=____, use_bias=____)(____)
# Create the second output (use the first output as input here)
output_tensor_2 = ____(____, activation=____, use_bias=____)(____)
# Create a model with 2 outputs
model = ____(____, [____, ____])