mlxtend
github:https://github.com/rasbt/mlxtend
doc:https://rasbt.github.io/mlxtend/
from mlxtend.plotting import plot_decision_regions
代码
value=[0, #feature1
1, #feature2
2, #feature3
3, #feature4
4, #feature5
5, #feature6
6, #feature7
7, #feature8
8, #feature9
9 #feature10
]
width=[0, #range1
1, #range2
2, #range3
3, #range4
4, #range5
5, #range6
6, #range7
7, #range8
8, #range9
9 #range10
]
fig = plot_decision_regions(X, y, clf=clf, #only array; clf is a model
feature_index=[8,9], #these feature will be plotted
filler_feature_values={0: value[0], 1:value[1], 2: value[2], 3:value[3], 4: value[4], 5:value[5],
6: value[6], 7:value[7]}, #these will be ignored
filler_feature_ranges={0: width[0], 1:width[1], 2: width[2], 3:width[3], 4: width[4], 5:width[5],
6: width[6], 7:width[7]})