Skip to content

Instantly share code, notes, and snippets.

@waelbenamara
waelbenamara / Dataset.csv
Last active September 5, 2019 20:04
Dataset
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
"""
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
"""
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],
"""
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