Skip to content

Instantly share code, notes, and snippets.

@abhijeet-talaulikar
Created August 31, 2023 13:58
Show Gist options
  • Save abhijeet-talaulikar/8bbb80edbe57e76a9505e5e9ecccc0dd to your computer and use it in GitHub Desktop.
Save abhijeet-talaulikar/8bbb80edbe57e76a9505e5e9ecccc0dd to your computer and use it in GitHub Desktop.
# 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