Skip to content

Commit

Permalink
Create example.py
Browse files Browse the repository at this point in the history
  • Loading branch information
notthatanonymous authored Oct 24, 2023
1 parent c29de21 commit e67db3c
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions example.py
Original file line number Diff line number Diff line change
@@ -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_))

0 comments on commit e67db3c

Please sign in to comment.