This commit is contained in:
Yevhenii Poliakov 2023-05-14 20:25:20 +02:00
parent 01a103f08b
commit 27860c181b

View File

@ -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))