From e67db3cd76e34a14437c9a9cd4f825159cb91138 Mon Sep 17 00:00:00 2001 From: Ahmad Abdellatif <124534399+notthatanonymous@users.noreply.github.com> Date: Mon, 23 Oct 2023 21:49:50 -0400 Subject: [PATCH] Create example.py --- example.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 example.py diff --git a/example.py b/example.py new file mode 100644 index 0000000..1db8c11 --- /dev/null +++ b/example.py @@ -0,0 +1,13 @@ +import numpy as np +from regain.covariance import LatentTimeGraphicalLasso +from regain.datasets import make_dataset +from regain.utils import error_norm_time + +np.random.seed(42) +data = make_dataset(n_dim_lat=1, n_dim_obs=3) +X = data.X +y = data.y +theta = data.thetas + +mdl = LatentTimeGraphicalLasso(max_iter=50).fit(X, y) +print("Error: %.2f" % error_norm_time(theta, mdl.precision_))