Created
June 20, 2016 11:37
-
-
Save LastZactionHero/411975006737f7055a3da6cbfedc7663 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from sklearn import linear_model | |
Y = np.array(Y) # array of training answers, 1 or 0 | |
X = np.array([]) # array of image brightness | |
for filename in filenames: | |
# load the images | |
image = misc.imread(constants.IMAGE_64_PATH + '/' + filename, mode='L') | |
avg_brightness = np.matrix(image).mean() | |
X = np.append(X, avg_brightness) | |
X = np.array([X]).transpose() | |
clf = linear_model.LogisticRegression(C=1e5) | |
clf.fit(X, Y) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment