flash手機(jī)網(wǎng)站制作排名優(yōu)化價(jià)格
目錄
- 漸變氣泡圖
- 彩色氣泡圖
在進(jìn)行實(shí)驗(yàn)結(jié)果分析的時(shí)候,氣泡標(biāo)尺圖能非常清晰對(duì)不同的結(jié)果進(jìn)行多維度的比較,特別是在深度學(xué)習(xí)模型大小和精度進(jìn)行比較的時(shí)候非常合適使用,以下是幾個(gè)例子。
漸變氣泡圖
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pddata = pd.DataFrame({'Model Size (MB)': [251, 218, 261, 280, 221],'Accuracy': [0.85, 0.88, 0.87, 0.91, 0.83],'Model Name': ['Resnet', 'Unet', 'Googlenet', 'Deeplabv3', 'Pspnet']
})# Create a bubble plot with larger circle sizes for different accuracies and a different colormap
plt.figure(figsize=(10, 6))
plot = sns.scatterplot(data=data, x='Model Size (MB)', y='Accuracy', size='Accuracy', hue='Accuracy', sizes=(100, 1000), cmap='viridis')
plt.title('Bubble Plot of Model Size vs. Accuracy in Deep Learning')
plt.xlabel('Model Size (MB)')
plt.ylabel('Accuracy')# Customize the legend and move it inside the plot to the upper left corner
plt.legend(title='Accuracy')
plt.gca().legend(loc='upper left', bbox_to_anchor=(0.02, 0.98))# Add model names near the circles
for line in range(0, data.shape[0]):plot.text(data['Model Size (MB)'][line], data['Accuracy'][line], data['Model Name'][line], horizontalalignment='left', size='medium', color='black', weight='semibold')# Adjust X-axis tick spacing
plt.xticks([200, 220, 240, 260, 280, 300])plt.show()
示例圖:
彩色氣泡圖
import seaborn as sns
import matplotlib.pyplot as plt
import pandas as pddata = pd.DataFrame({'Model Size (MB)': [251, 218, 261, 280, 221],'Accuracy': [0.85, 0.88, 0.87, 0.91, 0.83],'Model Name': ['Resnet', 'Unet', 'Googlenet', 'Deeplabv3', 'Pspnet']
})# Define a bright and colorful color palette
bright_palette = sns.color_palette("husl", as_cmap=True)# Create a bubble plot with larger circle sizes for different accuracies and the defined color palette
plt.figure(figsize=(10, 6))
plot = sns.scatterplot(data=data, x='Model Size (MB)', y='Accuracy', size='Accuracy', hue='Accuracy', sizes=(100, 1000), palette=bright_palette)
plt.title('Bubble Plot of Model Size vs. Accuracy in Deep Learning')
plt.xlabel('Model Size (MB)')
plt.ylabel('Accuracy')# Customize the legend and move it inside the plot to the upper left corner
plt.legend(title='Accuracy')
plt.gca().legend(loc='upper left', bbox_to_anchor=(0.02, 0.98))# Add model names near the circles
for line in range(0, data.shape[0]):plot.text(data['Model Size (MB)'][line], data['Accuracy'][line], data['Model Name'][line], horizontalalignment='left', size='medium', color='black', weight='semibold')# Adjust X-axis tick spacing
plt.xticks([200, 220, 240, 260, 280, 300])plt.show()
示例圖: