V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
GALI17
V2EX  ›  问与答

用 Python 模拟实现 Logit 模型时,最后报错 “PerfectSeparationError” ,该如何解决?

  •  
  •   GALI17 · Dec 25, 2018 · 1010 views
    This topic created in 2684 days ago, the information mentioned may be changed or developed.
    报错 “ statsmodels.tools.sm_exceptions.PerfectSeparationError: Perfect separation detected, results not available ” ,请问怎样规律的数据才能使用这个模型呢? Thanks♪(・ω・)ノ

    0 为因变量,1,2,3,4,5 为自变量

    我使用的测试数据:
    0 1 2 3 4 5
    1 1 1 1 1 1
    0 1 0 0 0 1
    1 0 1 1 1 0
    1 1 1 1 1 1
    0 1 0 0 0 1
    1 0 1 1 1 0
    1 0 0 1 1 0
    0 1 0 0 0 1
    1 0 1 1 1 0
    1 1 1 1 1 1
    0 1 0 1 0 1
    1 0 1 1 1 0
    1 0 1 1 1 0
    0 1 0 0 0 1
    1 0 1 1 1 0
    1 1 1 1 1 1
    0 1 0 0 0 1
    1 0 1 1 1 0
    1 1 1 1 1 1
    0 1 0 0 0 1
    1 0 1 0 1 0
    1 0 0 1 1 0
    0 1 0 0 0 1
    1 0 1 1 1 0
    1 1 1 1 1 1
    0 1 0 1 0 2
    1 1 1 1 1 0
    1 0 1 1 1 1
    0 1 0 0 0 1
    1 0 1 1 1 0
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   2131 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 00:48 · PVG 08:48 · LAX 17:48 · JFK 20:48
    ♥ Do have faith in what you're doing.