def categorizeCI2(inputDF, subsampleFactor=10, title=None):
#inputDF = normalize(inputDF)
binLabels = ['Low', 'Medium', 'High']
indices = range(0, inputDF.shape[0], subsampleFactor)
plotDF = inputDF.iloc[indices].copy()
plotDF['bin'] = pd.qcut(inputDF['ci'], len(binLabels), labels=binLabels)
plotDF.drop(['ci'], axis=1, inplace=True)
alpha = 0.3
g = parallel_coordinates(plotDF, 'bin',
color=[[0.8,0.0,0.1,alpha],
[0.0,0.8,0.1,alpha],
[0.1,0.1,0.8,alpha],
])
plt.xticks(rotation=270)
plt.legend(bbox_to_anchor=(1.05, 1), loc=2, borderaxespad=0.)
if title:
title += ' (factor=%d)' % subsampleFactor
g.set_title(title)
return g
评论列表
文章目录