From d8a749beef3210c69985dba0ec4bed7e8a76df6c Mon Sep 17 00:00:00 2001 From: Hugo Castaneda Date: Thu, 1 Feb 2024 11:39:34 +0100 Subject: [PATCH 1/3] fixed EDA feature cvx matrix creation --- flirt/eda/feature_calculation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/flirt/eda/feature_calculation.py b/flirt/eda/feature_calculation.py index f56542a..03528e6 100644 --- a/flirt/eda/feature_calculation.py +++ b/flirt/eda/feature_calculation.py @@ -136,6 +136,7 @@ def __cvx_eda(y, delta, tau0=2., tau1=0.7, delta_knot=10., alpha=8e-4, gamma=1e- """ n = len(y) + y = y.astype(np.double) y = cvx.matrix(y) # bateman ARMA model @@ -176,7 +177,7 @@ def __cvx_eda(y, delta, tau0=2., tau1=0.7, delta_knot=10., alpha=8e-4, gamma=1e- cvx.solvers.options.update(options) if solver == 'conelp': # Use conelp - z = lambda m, n: cvx.spmatrix([], [], [], (m, n)) + def z(m, n): return cvx.spmatrix([], [], [], (m, n)) G = cvx.sparse([[-A, z(2, n), M, z(nB + 2, n)], [z(n + 2, nC), C, z(nB + 2, nC)], [z(n, 1), -1, 1, z(n + nB + 2, 1)], [z(2 * n + 2, 1), -1, 1, z(nB, 1)], [z(n + 2, nB), B, z(2, nB), cvx.spmatrix(1.0, range(nB), range(nB))]]) From 4ada16ddfa7881549f371c52c964a97475aeb7f2 Mon Sep 17 00:00:00 2001 From: Hugo Castaneda Date: Thu, 1 Feb 2024 11:52:54 +0100 Subject: [PATCH 2/3] upd --- flirt/eda/feature_calculation.py | 1 - 1 file changed, 1 deletion(-) diff --git a/flirt/eda/feature_calculation.py b/flirt/eda/feature_calculation.py index 03528e6..75b1c0b 100644 --- a/flirt/eda/feature_calculation.py +++ b/flirt/eda/feature_calculation.py @@ -136,7 +136,6 @@ def __cvx_eda(y, delta, tau0=2., tau1=0.7, delta_knot=10., alpha=8e-4, gamma=1e- """ n = len(y) - y = y.astype(np.double) y = cvx.matrix(y) # bateman ARMA model From 43e9d24178e31b23cd10df10f38b680bb6aa7559 Mon Sep 17 00:00:00 2001 From: Hugo Castaneda Date: Thu, 1 Feb 2024 11:53:29 +0100 Subject: [PATCH 3/3] refix --- flirt/eda/feature_calculation.py | 1 + 1 file changed, 1 insertion(+) diff --git a/flirt/eda/feature_calculation.py b/flirt/eda/feature_calculation.py index 75b1c0b..03528e6 100644 --- a/flirt/eda/feature_calculation.py +++ b/flirt/eda/feature_calculation.py @@ -136,6 +136,7 @@ def __cvx_eda(y, delta, tau0=2., tau1=0.7, delta_knot=10., alpha=8e-4, gamma=1e- """ n = len(y) + y = y.astype(np.double) y = cvx.matrix(y) # bateman ARMA model