多特征决策边界的绘制

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]})
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值