Created
July 18, 2017 07:16
-
-
Save TomHortons/68023b27e469bdb25e0249477ba9f123 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
# Co-occurence Matrix | |
com = np.zeros([len(counts)]*2) | |
for i, l in enumerate(list(counts.keys())): | |
for i2, l2 in enumerate(list(counts.keys())): | |
c = 0 | |
cy = 0 | |
for row in labels.values: | |
if l in row: | |
c += 1 | |
if l2 in row: cy += 1 | |
com[i, i2] = cy / c | |
data=[go.Heatmap(z=com, x=list(counts.keys()), y=list(counts.keys()))] | |
layout=go.Layout(height=800, width=800, title='Co-occurence matrix of training labels') | |
fig=dict(data=data, layout=layout) | |
py.iplot(data, filename='train-com') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment