GALI17
V2EX  ›  问与答

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

  •  
  •   GALI17 · Dec 25, 2018 · 1042 views
    This topic created in 2705 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   ·   3086 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 31ms · UTC 10:49 · PVG 18:49 · LAX 03:49 · JFK 06:49
    ♥ Do have faith in what you're doing.