Last active
September 10, 2023 14:41
-
-
Save abhijeet-talaulikar/58c82f41840230850a6951cf1c4a8cf5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import plotly.express as px | |
# Best model | |
gmm = GaussianMixture(n_components=7) | |
gmm.fit(matrix) | |
# Get aspect labels and give names | |
labels = gmm.predict(matrix) | |
aspect_labels = { | |
0: "Loans - Repayment, high interest rates, false emails", | |
1: "Debt repayment - fraudulent activity, scam", | |
2: "Credit Report - false accounts, reporting errors", | |
3: "Credit Report - identity theft", | |
4: "Privacy - public disclosure of info, consent violation", | |
5: "False charges - incorrect account, debt", | |
6: "Privacy and identify theft mixed", | |
7: "Unknown verification requests" | |
} | |
review_data['labels'] = pd.Series(labels).map(aspect_labels) | |
# Plot | |
fig = px.scatter(x=x, y=y, color=review_data['labels'], labels=review_data['labels']) | |
fig.update_layout( | |
autosize=False, | |
width=1300, | |
height=600, | |
legend=dict( | |
title="Aspect", | |
font = dict(size = 10) | |
) | |
) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment