You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+9-5Lines changed: 9 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,7 +36,7 @@ Loading pickled pystan.fit objects into memory is also safer using `cached_stan_
36
36
Getting started
37
37
---------------
38
38
39
-
### Configuratation
39
+
### Configuration
40
40
41
41
The configuration uses python's [configparser](https://docs.python.org/2/library/configparser.html) module, allowing the user to either load a `config.ini` file from disk or set the configuration in code.
42
42
@@ -46,7 +46,7 @@ Currently, the config settings include
46
46
47
47
*`CACHE_DIR` (defaults to `.cached_models`)
48
48
*`SEED` (seed value passed to `pystan.stan` for reproducible research)
49
-
*`SET_SEED` (boolean, whether to set the random.seed, systemwide in addition to stan_seed)
49
+
*`SET_SEED` (boolean, whether to set the random.seed systemwide in addition to stan_seed)
50
50
51
51
You can use `config.set_value(NAME=value)` to modify a setting.
52
52
@@ -74,11 +74,15 @@ Also see `?stancache.cached_stan_fit` for more details.
74
74
75
75
### Caching other items
76
76
77
-
The caching is very sensitive to certain things which would change the returned object, such as the sort order of your data elements within the dictionary. But is not sensitive to other things (such as whether you use a file-based stan code or string-based version of same code).
77
+
The caching is very sensitive to certain things which would change the returned object, such as the sort order of your data elements within the dictionary. But is not sensitive to other things, such as whether you use a file-based stan code or string-based version of same code.
78
78
79
-
In practice, we find that it can be helpful to cache data-preparation steps, especially when simulating data. There is thus as`stancache.cached()` wrapper function for this purpose, to cache all objects _other_ than `pystan.stan` objects using the same file-cache settings.
79
+
In practice, we find that it can be helpful to cache data-preparation steps, especially when simulating data. There is thus a`stancache.cached()` wrapper function for this purpose,. This will save or cache all objects _other_ than `pystan.stan` objects to disk using the same file-cache settings as are used for stancache.
80
80
81
-
A fairly common set-up for us is, for example, to fit a set of models in a distributed execution environment, then review the model results in a set of jupyter notebooks. In this case, in our jupyter notebook we will set a parameter of `cache_only=True` when loading model results into the Jupyter notebook to force a failure if the cache is not available.
81
+
### Avoiding re-executing a model
82
+
83
+
There are a number of scenarios where you might want to use a cache of fitted models in read-only mode. You can avoid accidentally re-fitting the model by setting `cache_only=True`.
84
+
85
+
For example, you may have fit a set of models which you want to read into a jupyter notebook for model exploration. Or, you may be reviewing a colleague's fitted model objects. Note that this is foolproof so please back up your work.
0 commit comments