From ca4fe6932b83f2118dbcb367a15f6dc248a6fdf6 Mon Sep 17 00:00:00 2001 From: Yevhenii Poliakov Date: Sun, 14 May 2023 20:39:55 +0200 Subject: [PATCH] upd 5 --- script5.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/script5.py b/script5.py index afabee2..4645837 100644 --- a/script5.py +++ b/script5.py @@ -17,9 +17,9 @@ y = data['Rating'] # Preprocess the data # Convert the categorical columns into numerical representations mlb = MultiLabelBinarizer() -X['Generes'] = mlb.fit_transform(X['Generes']) -X['Plot Kyeword'] = mlb.fit_transform(X['Plot Kyeword']) -X['Top 5 Casts'] = mlb.fit_transform(X['Top 5 Casts'].astype(str)) +X['Generes'] = mlb.fit_transform(X['Generes']).tolist() +X['Plot Kyeword'] = mlb.fit_transform(X['Plot Kyeword']).tolist() +X['Top 5 Casts'] = mlb.fit_transform(X['Top 5 Casts'].astype(str)).tolist() # Split the data into training and testing sets X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2, random_state=42)