Complete the code to create a simple model with one dense layer.
model = tf.keras.Sequential([tf.keras.layers.Dense([1], input_shape=(3,))])
The model has one dense layer with 1 output unit, matching a simple regression or binary output.
Complete the code to compile the model with mean squared error loss.
model.compile(optimizer='adam', loss='[1]')
Mean squared error is used for regression tasks to measure the difference between predicted and true values.
Fix the error in the training code by filling the correct method name.
history = model.[1](x_train, y_train, epochs=5)
The correct method to train a TensorFlow Keras model is fit.
Fill both blanks to create a dictionary comprehension that stores squared values for even numbers.
squares = {x: x[1]2 for x in range(1, 6) if x [2] 2 == 0}Use ** to square numbers and % to check if a number is even (remainder 0).
Fill all three blanks to create a filtered dictionary with uppercase keys and values greater than zero.
result = [1]: [2] for k, v in data.items() if v [3] 0}
Keys are converted to uppercase with k.upper(), values are kept as v, and filtered where v > 0.