简体   繁体   English

具有7个功能的Scikit Logistic回归的绘图决策边界

[英]Plot Decision Boundary for Scikit Logistic Regression with 7 Features

I'm implementing binary logistic regression with 7 features in Python with scikit-learn, and I want to plot the decision boundary for it (preferably in Matplotlib). 我正在使用scikit-learn在Python中使用7个功能实现二进制逻辑回归,并且我想为其绘制决策边界(最好在Matplotlib中)。 I've seen this and this and this , but none of those work for me when I try to implement them; 我已经看过这个这个这个 ,但是当我尝试实现它们时,这些都不对我有用。 some require me to only train the model on two features, which I would not prefer. 有些要求我仅在两个功能上训练模型,而我不希望这样做。

Ideally, I would like to plot the boundary in both 2d and 3d, 理想情况下,我想绘制2d和3d的边界, 2D

3D

but either would be fine. 但任何一个都可以。

You can not visualize data in dimensions greater than 3, as it is really hard to plot points that have more than 3 dimensions. 您无法可视化尺寸大于3的数据,因为要绘制尺寸大于3的点确实很困难。 Using color / hue maybe you get get up to 4 or 5. So even visualizing your data is impossible, let alone a decision function in this dimension. 使用颜色/色相可能会达到4或5。因此即使可视化数据也是不可能的,更不用说此维度上的决策功能了。 What do you mean by plotting the boundary in 2d or 3d? 在2d或3d中绘制边界是什么意思?

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM