

def test_perfect_prediction():
    cur_dir = os.path.dirname(os.path.abspath(__file__))
    iris_dir = os.path.join(iris_dir, '..', '..', 'genmod', 'tests', 'results')
    iris_dir = os.path.abspath(iris_dir)
    iris = np.genfromtxt(os.path.join(iris_dir, 'iris.csv'), delimiter=',', skip_header=1)
    y = iris[:, (- 1)]
    X = iris[:, :(- 1)]
    X = X[(y != 2)]
    y = y[(y != 2)]
    X = sm.add_constant(X, prepend=True)
    mod = Logit(y, X)
    assert_raises(PerfectSeparationError, mod.fit, maxiter=1000)
    mod.raise_on_perfect_prediction = False
    from pandas.util.testing import assert_produces_warning
    with assert_produces_warning():
        mod.fit(disp=False, maxiter=50)

dataset/ETHPy150Open statsmodels/statsmodels/statsmodels/discrete/tests/test_discrete.py test_perfect_prediction/VarMisuse@35/45 `cur_dir`->`iris_dir`