dividing two sets of points I have a series of points an a single real-valued axis. The points are either good or bad (encoded as 0 or 1). Generally zeros are bigger than ones. But they sometimes overlap. I need to a point which devised the two groups best. What techniques could I use? I thought about logistic regression, but do not know how do find the dividing number than.
 A: If you want to use logistic regression to find the cutpoint the following R-code should work:
df <- data.frame(x <- c(-5, -1, 3, 0, -4, 4,1,-1, 4, 2),
                 y <- c(0,0,0,0,0,1,1,1,1,1))
fit <- glm(y ~ x, family="binomial", data=df)
# This gives you the cutpoint:
-fit$coefficients[1] / fit$coefficients[2]
## 0.4600296 

If you don't use R, just calculate -Intercept / RegressionCoefficient.
Edit:
The code above gives you the cutpoint ($x$) that results in the corresponding logistic function being 0.5, that is, halfway between the two extremes 0 and 1. Say you got an intercept, $\beta_0$, and an regression coefficient, $\beta_1$. The logistic function is 0.5 when $\beta_0 + \beta_1x=0$ which gives $x=-\beta_0 / \beta_1$

A: @Rasmus's answer in Python: (upvote him)
import statsmodels.api as sm
import numpy as np
y = [0,0,0,0,0,1,1,1,1,1]
x = [-5, -1, 3, 0, -4, 4,1,-1, 4, 2]
X = np.array([[1 for _ in range(len(x))], x])
result = sm.GLM(y, X.T, family=sm.families.Binomial() ).fit()
result.summary()
print -result.params[0]/result.params[1]

