From 27860c181baed1d84a14559ad75ac6ae9c07514f Mon Sep 17 00:00:00 2001 From: Yevhenii Poliakov Date: Sun, 14 May 2023 20:25:20 +0200 Subject: [PATCH] upd 5 --- script5.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script5.py b/script5.py index cd582b1..0131bf6 100644 --- a/script5.py +++ b/script5.py @@ -17,7 +17,7 @@ y = data['Rating'] # Preprocess the data # Convert the categorical columns into numerical representations mlb = MultiLabelBinarizer() -X['Genres'] = mlb.fit_transform(X['Generes']) +X['Generes'] = mlb.fit_transform(X['Generes']) X['Plot Keyword'] = mlb.fit_transform(X['Plot Kyeword']) X['Top 5 Casts'] = mlb.fit_transform(X['Top 5 Casts']) @@ -26,7 +26,7 @@ X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_ # Create the neural network model model = Sequential() -model.add(Embedding(input_dim=len(mlb.classes_), output_dim=10, input_length=X.shape[1])) +model.add(Embedding(input_dim=len(mlb.classes_), output_dim=10, input_length=X.shape[24402, 39])) model.add(Flatten()) model.add(Dense(32, activation='relu')) model.add(Dense(1))