bubble-economy / flock.py

Diff from to
     'n_branches': 100,
 }
 
+def plot_of_swept_experiment(iterable):
+    import matplotlib.pyplot as plt
+    from collections import defaultdict
+    from scipy.stats.mstats import mquantiles
+    valz = defaultdict(list)
+    for param, val in iterable:
+        valz[param['noise']].extend(list(val))
+    x = np.array(sorted(valz.keys()))
+    y_arrays = [np.array(valz[x_val]) for x_val in x]
+    y_medians = np.array([mquantiles(y_array, prob=[0.5])[0] for y_array in y_arrays])
+    y_low = np.array([mquantiles(y_array, prob=[0.25])[0] for y_array in y_arrays])
+    y_high = np.array([mquantiles(y_array, prob=[0.75])[0] for y_array in y_arrays])
+    y_err = np.vstack([y_medians-y_low, y_high-y_medians])
+    plt.errorbar(x, y_medians, yerr=y_err)
+    return x, y_arrays
+
 def stashed_swept_experiment(db_url = OUTPUT_DB_URL, *args, **kwargs):
     import persistence
     session = persistence.get_db_session(OUTPUT_DB_URL)
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.