Created
August 31, 2023 13:58
-
-
Save abhijeet-talaulikar/8bbb80edbe57e76a9505e5e9ecccc0dd 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
# Get inclusion probabilities | |
probabilities = gmm.predict_proba(matrix) | |
proba_df = pd.DataFrame(probabilities, columns = aspect_labels.values()) | |
# Get dominant aspects | |
fig = px.line_polar( | |
pd.DataFrame({ | |
"aspect": proba_df.idxmax(axis=1), | |
"max_proba": proba_df.lookup(proba_df.index, proba_df.idxmax(axis=1)) | |
}).groupby("aspect").sum().reset_index(), | |
r="max_proba", | |
theta="aspect", | |
line_close=True | |
) | |
fig.update_traces(fill='toself') | |
fig.update_layout(polar = dict(radialaxis = dict(showticklabels = False))) | |
fig.show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment