File: fix_random_seeds.patch

package info (click to toggle)
statsmodels 0.14.5%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 49,940 kB
  • sloc: python: 253,284; f90: 612; sh: 560; javascript: 337; asm: 156; makefile: 145; ansic: 16; xml: 9
file content (109 lines) | stat: -rw-r--r-- 3,201 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
Description: Fix random seeds for reproducibility

Author: Rebecca N. Palmer <rebecca_palmer@zoho.com>
Forwarded: no

--- a/examples/notebooks/copula.ipynb
+++ b/examples/notebooks/copula.ipynb
@@ -19,7 +19,8 @@
     "from scipy import stats\n",
     "\n",
     "sns.set_style(\"darkgrid\")\n",
-    "sns.mpl.rc(\"figure\", figsize=(8, 8))"
+    "sns.mpl.rc(\"figure\", figsize=(8, 8))\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/examples/notebooks/ets.ipynb
+++ b/examples/notebooks/ets.ipynb
@@ -31,7 +31,8 @@
     "import pandas as pd\n",
     "\n",
     "%matplotlib inline\n",
-    "from statsmodels.tsa.exponential_smoothing.ets import ETSModel"
+    "from statsmodels.tsa.exponential_smoothing.ets import ETSModel\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/examples/notebooks/exponential_smoothing.ipynb
+++ b/examples/notebooks/exponential_smoothing.ipynb
@@ -38,6 +38,7 @@
     "import numpy as np\n",
     "import pandas as pd\n",
     "from statsmodels.tsa.api import ExponentialSmoothing, Holt, SimpleExpSmoothing\n",
+    "np.random.seed(1234) # for reproducibility\n",
     "\n",
     "%matplotlib inline\n",
     "\n",
--- a/examples/notebooks/gee_nested_simulation.ipynb
+++ b/examples/notebooks/gee_nested_simulation.ipynb
@@ -19,7 +19,8 @@
    "source": [
     "import numpy as np\n",
     "import pandas as pd\n",
-    "import statsmodels.api as sm"
+    "import statsmodels.api as sm\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/examples/notebooks/gee_score_test_simulation.ipynb
+++ b/examples/notebooks/gee_score_test_simulation.ipynb
@@ -23,7 +23,8 @@
     "import numpy as np\n",
     "from scipy.stats.distributions import norm, poisson\n",
     "import statsmodels.api as sm\n",
-    "import matplotlib.pyplot as plt"
+    "import matplotlib.pyplot as plt\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/examples/notebooks/plots_boxplots.ipynb
+++ b/examples/notebooks/plots_boxplots.ipynb
@@ -24,7 +24,8 @@
     "\n",
     "import numpy as np\n",
     "import matplotlib.pyplot as plt\n",
-    "import statsmodels.api as sm"
+    "import statsmodels.api as sm\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/examples/notebooks/predict.ipynb
+++ b/examples/notebooks/predict.ipynb
@@ -28,7 +28,8 @@
     "import statsmodels.api as sm\n",
     "\n",
     "plt.rc(\"figure\", figsize=(16, 8))\n",
-    "plt.rc(\"font\", size=14)"
+    "plt.rc(\"font\", size=14)\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/examples/notebooks/robust_models_0.ipynb
+++ b/examples/notebooks/robust_models_0.ipynb
@@ -24,7 +24,8 @@
    "source": [
     "import matplotlib.pyplot as plt\n",
     "import numpy as np\n",
-    "import statsmodels.api as sm"
+    "import statsmodels.api as sm\n",
+    "np.random.seed(1234) # for reproducibility"
    ]
   },
   {
--- a/docs/source/emplike.rst
+++ b/docs/source/emplike.rst
@@ -43,6 +43,7 @@ Examples
 
   import numpy as np
   import statsmodels.api as sm
+  np.random.seed(50)  # for reproducibility
 
   # Generate Data
   x = np.random.standard_normal(50)