Skip to content

Instantly share code, notes, and snippets.

View sgbaird's full-sized avatar

Sterling G. Baird sgbaird

View GitHub Profile
@sgbaird
sgbaird / ordinal_example.py
Created December 8, 2021 23:23
Create some dummy data and generate ordinal encodings and parameters/constraints according to the Ax (adaptive design) framework.
"""Create some dummy data and generate ordinal encodings and parameters/constraints."""
import numpy as np
import pandas as pd
# %% data and choices
data = [["A", "B", "C"], ["D", "C", "A"], ["C", "A", "B"], ["C", "B", "A"]]
choices = list(np.unique(np.array(data).flatten()))
n_choices = len(choices)
# %% ordinal encoding
@sgbaird
sgbaird / History\-10222c04\entries.json
Last active June 21, 2022 04:00
Visual Studio Code Settings Sync Gist
{"version":1,"resource":"file:///c%3A/Users/sterg/Documents/GitHub/sparks-baird/bayes-opt-particle-packing/examples/paper_validation.py","entries":[{"id":"gqAt.py","timestamp":1651021972834},{"id":"J1l2.py","timestamp":1651022141759},{"id":"6PfT.py","timestamp":1651022226714},{"id":"vncu.py","timestamp":1651022242814},{"id":"95KM.py","timestamp":1651022353874},{"id":"xT1o.py","timestamp":1651022370345},{"id":"YpAY.py","timestamp":1651022424085},{"id":"VND3.py","timestamp":1651022453142},{"id":"uo2a.py","timestamp":1651022535298},{"id":"tyPf.py","source":"undoRedo.source","timestamp":1651022538140},{"id":"0bdL.py","timestamp":1651022558334},{"id":"2hpb.py","timestamp":1651022596152},{"id":"Hwyi.py","timestamp":1651022641384},{"id":"TjAr.py","timestamp":1651022741313},{"id":"GagW.py","timestamp":1651022767550},{"id":"dq1b.py","timestamp":1651022796139},{"id":"8Bb5.py","timestamp":1651022854709},{"id":"wHzw.py","timestamp":1651022883678},{"id":"7UtE.py","timestamp":1651022992369},{"id":"KjN9.py","timestamp":1651