brendabor commited on
Commit
28336f5
1 Parent(s): b26a98b

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
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, audio_features_df], axis=1)
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]