Creating a new prediction for the Keras.io BST model
The Keras.io example of a Transformer-based recommendation system is a great example for me to understanding neural networks in Keras. But how would you use the create_model_inputs() to get a new prediction of a non existing user through model.predict() without feeding array data like .predict(sc.transform(np.array([[0.26, 0.7, 3., 238., 6., 0., 0.,]])))
but by entering the strings/ints to make it more readable and use a variant for user testing?
def create_model_inputs():
return {
user_id: layers.Input(name=user_id, shape=(1,), dtype=tf.string),
sequence_movie_ids: layers.Input(
name=sequence_movie_ids, shape=(sequence_length - 1,), dtype=tf.string
),
target_movie_id: layers.Input(
name=target_movie_id, shape=(1,), dtype=tf.string
),
sequence_ratings: layers.Input(
name=sequence_ratings, shape=(sequence_length - 1,), dtype=tf.float32
),
sex: layers.Input(name=sex, shape=(1,), dtype=tf.string),
age_group: layers.Input(name=age_group, shape=(1,), dtype=tf.string),
occupation: layers.Input(name=occupation, shape=(1,), dtype=tf.string),
}
Topic transformer prediction keras tensorflow recommender-system
Category Data Science