This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| Dirichlet-Categorical Bayesian Learning: Alice's Dietary Preference | |
| Exact Implementation of Thesis Example with Gibbs Sampling | |
| 4-Category Model: Vegan, Vegetarian, Pescatarian, Omnivore | |
| Run this script to generate all CSVs and plots. | |
| Results will be saved in the current directory. | |
| """ | |
| import numpy as np |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from mpl_toolkits.mplot3d import Axes3D | |
| from mpl_toolkits.mplot3d.art3d import Poly3DCollection | |
| alpha = np.array([2, 2, 2, 2]) | |
| def barycentric_to_cartesian(bary): | |
| vertices = np.array([ | |
| [1, 0, 0], |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| """ | |
| This code demonstrates Gibbs sampling over a probabilistic database | |
| with two delta-tuples representing dietary preferences constrained by | |
| two query-answer observations. | |
| ref = https://openproceedings.org/2022/conf/edbt/paper-66.pdf | |
| Gamma Probabilistic Databases: | |
| Learning from Exchangeable Query-Answers | |
| """ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| priceUsd | moving_average_1 | moving_average_2 | crossover | linear_regression | label | |
|---|---|---|---|---|---|---|
| 4261.48 | 0 | 1 | 1 | |||
| 4261.48 | 0 | 1 | 1 | |||
| 4280.56 | 0 | 1 | 0 | |||
| 4261.48 | 0 | 1 | 1 | |||
| 4261.48 | 4265.2959999999985 | 0 | 1 | 1 | ||
| 4261.48 | 4265.2959999999985 | 0 | 0 | 1 | ||
| 4261.48 | 4265.2959999999985 | 0 | 0 | 1 | ||
| 4261.48 | 4261.48 | 0 | 0 | 1 | ||
| 4261.48 | 4261.48 | 0 | 0 | 1 |