Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sort imports in another 9 notebooks #4074

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions docs/source/notebooks/GLM-robust.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,9 @@
"source": [
"%matplotlib inline\n",
"\n",
"import pymc3 as pm\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"\n",
"import pymc3 as pm\n",
"import theano"
]
},
Expand Down
12 changes: 6 additions & 6 deletions docs/source/notebooks/GP-MeansAndCovs.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
},
"outputs": [],
"source": [
"import matplotlib.pyplot as plt\n",
"import matplotlib.cm as cmap\n",
"%matplotlib inline\n",
"\n",
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"np.random.seed(206)\n",
"\n",
"import pymc3 as pm\n",
"import theano\n",
"import theano.tensor as tt\n",
"import pymc3 as pm"
"\n",
"%matplotlib inline\n",
"\n",
"np.random.seed(206)"
]
},
{
Expand Down
3 changes: 2 additions & 1 deletion docs/source/notebooks/bayes_param_survival_pymc3.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@
"from matplotlib import pyplot as plt\n",
"from matplotlib.ticker import StrMethodFormatter\n",
"from statsmodels import datasets\n",
"from theano import shared, tensor as tt\n",
"from theano import shared\n",
"from theano import tensor as tt\n",
"\n",
"print('Running on PyMC3 v{}'.format(pm.__version__))"
]
Expand Down
9 changes: 5 additions & 4 deletions docs/source/notebooks/dependent_density_regression.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,10 @@
"import seaborn as sns\n",
"\n",
"from IPython.display import HTML\n",
"from matplotlib import animation as ani, pyplot as plt\n",
"from theano import shared, tensor as tt\n",
"from matplotlib import animation as ani\n",
"from matplotlib import pyplot as plt\n",
"from theano import shared\n",
"from theano import tensor as tt\n",
"\n",
"print('Running on PyMC3 v{}'.format(pm.__version__))"
]
Expand Down Expand Up @@ -1109,8 +1111,7 @@
"\n",
"with model:\n",
" step = pm.Metropolis()\n",
" trace = pm.sample(SAMPLES, step, chains=1, tune=BURN, random_seed=SEED)\n",
" "
" trace = pm.sample(SAMPLES, step, chains=1, tune=BURN, random_seed=SEED)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/dp_mix.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@
"import numpy as np\n",
"import pandas as pd\n",
"import pymc3 as pm\n",
"import seaborn as sns\n",
"import scipy as sp\n",
"import seaborn as sns\n",
"\n",
"from matplotlib import pyplot as plt\n",
"from theano import tensor as tt\n",
Expand Down
5 changes: 3 additions & 2 deletions docs/source/notebooks/factor_analysis.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,18 @@
}
],
"source": [
"import warnings\n",
"\n",
"import arviz as az\n",
"import matplotlib\n",
"import numpy as np\n",
"import pymc3 as pm\n",
"import seaborn as sbn\n",
"import scipy as sp\n",
"import scipy.sparse\n",
"import scipy.sparse.linalg\n",
"import seaborn as sbn\n",
"import theano as T\n",
"import theano.tensor as tt\n",
"import warnings\n",
"\n",
"from matplotlib import pyplot as plt\n",
"\n",
Expand Down
4 changes: 3 additions & 1 deletion docs/source/notebooks/getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -875,6 +875,7 @@
],
"source": [
"import warnings\n",
"\n",
"with warnings.catch_warnings():\n",
" warnings.filterwarnings('ignore', category=UserWarning)\n",
" returns.plot(figsize=(10, 6))\n",
Expand Down Expand Up @@ -3407,7 +3408,7 @@
" labels = [label.get_text() for label in ax.get_xticklabels()]\n",
" ax.set_xticklabels(labels, rotation=45, ha='right')\n",
" break\n",
"plt.draw() "
"plt.draw()"
]
},
{
Expand Down Expand Up @@ -3491,6 +3492,7 @@
"outputs": [],
"source": [
"import theano.tensor as tt\n",
"\n",
"from theano.compile.ops import as_op\n",
"\n",
"\n",
Expand Down
3 changes: 2 additions & 1 deletion docs/source/notebooks/multilevel_modeling.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -64,13 +64,14 @@
}
],
"source": [
"import warnings\n",
"\n",
"import arviz as az\n",
AlexAndorra marked this conversation as resolved.
Show resolved Hide resolved
"import matplotlib.pyplot as plt\n",
"import numpy as np\n",
"import pandas as pd\n",
"import pymc3 as pm\n",
"import xarray as xr\n",
"import warnings\n",
"\n",
"from theano import tensor as tt\n",
"\n",
Expand Down
11 changes: 6 additions & 5 deletions docs/source/notebooks/probabilistic_matrix_factorization.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
],
AlexAndorra marked this conversation as resolved.
Show resolved Hide resolved
"source": [
"%matplotlib inline\n",
"import pymc3 as pm\n",
"import numpy as np\n",
"import pandas as pd\n",
"import pymc3 as pm\n",
"\n",
"from matplotlib import pyplot as plt\n",
"\n",
"plt.style.use('seaborn-darkgrid')\n",
Expand Down Expand Up @@ -767,11 +768,11 @@
"metadata": {},
"outputs": [],
"source": [
"import time\n",
"import logging\n",
"import theano\n",
"import scipy as sp\n",
"import time\n",
"\n",
"import scipy as sp\n",
"import theano\n",
"\n",
"# Enable on-the-fly graph computations, but ignore\n",
"# absence of intermediate test values.\n",
Expand Down Expand Up @@ -1056,7 +1057,7 @@
" Method = baseline_methods[name]\n",
" method = Method(train)\n",
" baselines[name] = method.rmse(test)\n",
" print('%s RMSE:\\t%.5f' % (method, baselines[name]))\n"
" print('%s RMSE:\\t%.5f' % (method, baselines[name]))"
]
},
{
Expand Down