Last active
October 27, 2017 15:23
-
-
Save rubik/74ddad91317b4d366d3879e031e03396 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
import numpy as np | |
import pymc3 as pm | |
import theano as t | |
train_new = np.load('train_new.npy') | |
targets = np.load('y.npy') | |
X = t.shared(train_new) | |
features = list(map(str, range(train_new.shape[1]))) | |
with pm.Model() as logistic_model: | |
# we won't estimate the intercept because the data is centered | |
glm = pm.glm.GLM(X, targets, labels=features, | |
intercept=False, family='binomial') | |
trace = pm.sample(3000, tune=3000, jobs=-1) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment