Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -40,10 +40,10 @@ def hybrid_recommendation(song_index):
|
|
40 |
mood_cats = df[['mood_cats']]
|
41 |
mood_cats_df = pd.DataFrame(mood_cats)
|
42 |
audio_features_scaled_knn = scaler_knn.fit_transform(audio_features_knn)
|
43 |
-
|
44 |
-
audio_features_df = pd.DataFrame(audio_features_scaled_knn, columns=audio_features_knn.columns)
|
45 |
# Combine mood and audio features
|
46 |
-
combined_features = pd.concat([mood_cats_df,
|
47 |
|
48 |
# Predict using the KNN model
|
49 |
knn_recommendations = knn_model.kneighbors(combined_features, n_neighbors=5, return_distance=False)[0]
|
|
|
40 |
mood_cats = df[['mood_cats']]
|
41 |
mood_cats_df = pd.DataFrame(mood_cats)
|
42 |
audio_features_scaled_knn = scaler_knn.fit_transform(audio_features_knn)
|
43 |
+
audio_features_df_knn = pd.DataFrame(audio_features_scaled_knn, columns=audio_features_knn.columns.tolist())
|
44 |
+
#audio_features_df = pd.DataFrame(audio_features_scaled_knn, columns=audio_features_knn.columns)
|
45 |
# Combine mood and audio features
|
46 |
+
combined_features = pd.concat([mood_cats_df, audio_features_df_knn], axis=1)
|
47 |
|
48 |
# Predict using the KNN model
|
49 |
knn_recommendations = knn_model.kneighbors(combined_features, n_neighbors=5, return_distance=False)[0]
|