Skip to content

Commit

Permalink
Merge f10c820 into 35c6c44
Browse files Browse the repository at this point in the history
  • Loading branch information
fonnesbeck committed Jan 19, 2017
2 parents 35c6c44 + f10c820 commit 98d7f6d
Show file tree
Hide file tree
Showing 12 changed files with 26 additions and 305 deletions.
2 changes: 1 addition & 1 deletion pymc3/__init__.py
Expand Up @@ -3,6 +3,7 @@
from .blocking import *
from .distributions import *
from .external import *
from .linear_models import *
from .math import logsumexp, logit, invlogit
from .model import *
from .stats import *
Expand All @@ -23,7 +24,6 @@

from .tests import test

from . import glm
from .data import *

import logging
Expand Down
2 changes: 0 additions & 2 deletions pymc3/glm/__init__.py

This file was deleted.

270 changes: 0 additions & 270 deletions pymc3/glm/glm.py

This file was deleted.

2 changes: 2 additions & 0 deletions pymc3/linear_models/__init__.py
@@ -0,0 +1,2 @@
from .linear import LinearComponent, GLM
from . import families
File renamed without changes.
10 changes: 5 additions & 5 deletions pymc3/models/linear.py → pymc3/linear_models/linear.py
Expand Up @@ -2,13 +2,13 @@
import pandas as pd
import numpy as np
from ..distributions import Normal, Flat
from ..glm import families
from . import families
from ..model import Model, Deterministic
from .utils import any_to_tensor_and_labels

__all__ = [
'LinearComponent',
'Glm'
'GLM'
]


Expand Down Expand Up @@ -87,7 +87,7 @@ def from_formula(cls, formula, data, priors=None, vars=None, name='', model=None
priors=priors, vars=vars, name=name, model=model)


class Glm(LinearComponent):
class GLM(LinearComponent):
"""Creates glm model, y_est is accessible via attribute
Parameters
----------
Expand All @@ -103,11 +103,11 @@ class Glm(LinearComponent):
defaults to Normal.dist(mu=0, tau=1.0E-6)
init : dict - test_vals for coefficients
vars : dict - random variables instead of creating new ones
family : pymc3.glm.families object
family : pymc3.linear_models.families object
"""
def __init__(self, x, y, intercept=True, labels=None,
priors=None, vars=None, family='normal', name='', model=None):
super(Glm, self).__init__(
super(GLM, self).__init__(
x, y, intercept=intercept, labels=labels,
priors=priors, vars=vars, name=name, model=model
)
Expand Down
File renamed without changes.
6 changes: 0 additions & 6 deletions pymc3/models/__init__.py

This file was deleted.

4 changes: 1 addition & 3 deletions pymc3/tests/test_examples.py
Expand Up @@ -192,16 +192,14 @@ def build_model(self):
self.y = true_intercept + self.x * true_slope + np.random.normal(scale=.5, size=size)
data = dict(x=self.x, y=self.y)
with pm.Model() as model:
pm.glm.glm('y ~ x', data)
pm.GLM.from_formula('y ~ x', data)
return model

def test_run(self):
with self.build_model():
start = pm.find_MAP(fmin=opt.fmin_powell)
trace = pm.sample(50, pm.Slice(), start=start)

pm.glm.plot_posterior_predictive(trace)


class TestLatentOccupancy(SeededTest):
"""
Expand Down

0 comments on commit 98d7f6d

Please sign in to comment.