Creating the dot model

Our first model will consist of two embedding layers, one for the movie index and one for the user index, as well as their dot product. We will use the keras.layers package, which contains the necessary layer implementations, as well as the Model implementation from the keras.models package. The layers that we will utilize are as follows:

  • TheInput layer, which is responsible for creating Keras tensors from more conventional Python data types
  • The Embedding layer, which is the implementation of embedding layers
  • The Flatten layer, which transforms any Keras n-dimensional tensor to a single dimensional tensor
  • The Dot layer, which implements the dot product

Furthermore, we will utilize train_test_split and metrics from ...

Get Hands-On Ensemble Learning with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.