Skip to content

Commit

Permalink
Update reputation_system.py
Browse files Browse the repository at this point in the history
  • Loading branch information
KOSASIH authored Aug 14, 2024
1 parent 499b29f commit 1fa50cc
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion projects/PiNetAI/ai/models/reputation_system.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,4 +198,34 @@ def calculate_collaborative_feature(self, user_id, item_id, user_item_matrix):
predictions = reputation_system.predict_reputation_scores(reputation_scores)

# Evaluate models
metrics = reputation_system.evaluate
metrics = reputation_system.evaluate_models(predictions)

# Visualize results
reputation_system.visualize_results(metrics)

# Optimize hyperparameters
best_model = reputation_system.optimize_hyperparameters()

# Calculate text features
text_data = pd.read_csv('text_data.csv')
text_features = reputation_system.calculate_text_features(text_data)

# Calculate collaborative features
collaborative_features = reputation_system.calculate_collaborative_features(user_item_matrix)

# Combine features
combined_features = np.concatenate((reputation_scores, text_features, collaborative_features), axis=1)

# Train final model
final_model = reputation_system.models['Neural Network']
final_model.fit(combined_features, reputation_system.data['rating'])

# Evaluate final model
final_prediction = final_model.predict(combined_features)
final_metrics = reputation_system.evaluate_models({'Final Model': final_prediction})

# Visualize final results
reputation_system.visualize_results(final_metrics)

# Save final model
final_model.save('final_model.h5')

0 comments on commit 1fa50cc

Please sign in to comment.