pyANOVAapprox 0.1.2__tar.gz → 0.2.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/.github/workflows/ci.yml +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/PKG-INFO +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/pyproject.toml +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/simpleTest/examplePeriodic.py +23 -13
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/src/pyANOVAapprox/approx.py +9 -6
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/cheb_fista.py +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/cheb_lsqr.py +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/per_fista.py +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/per_lsqr.py +1 -1
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/.github/workflows/documentation.yml +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/.github/workflows/format.yml +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/.github/workflows/release.yml +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/.gitignore +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/LICENSE +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/README.md +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/docs/Makefile +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/docs/source/Analysis.rst +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/docs/source/Approximation.rst +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/docs/source/Errors.rst +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/docs/source/conf.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/docs/source/index.rst +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/src/pyANOVAapprox/__init__.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/src/pyANOVAapprox/analysis.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/src/pyANOVAapprox/errors.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/src/pyANOVAapprox/fista.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/src/pyANOVAapprox/trafos.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/TestFunctionCheb.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/TestFunctionPeriodic.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/run_tests.py +0 -0
- {pyanovaapprox-0.1.2 → pyanovaapprox-0.2.0}/tests/wav_lsqr.py +0 -0
|
@@ -10,7 +10,7 @@ jobs:
|
|
|
10
10
|
test:
|
|
11
11
|
strategy:
|
|
12
12
|
matrix:
|
|
13
|
-
python-version: ['3.12'] # Specify the Python versions you want to test against
|
|
13
|
+
python-version: ['3.11', '3.12'] # Specify the Python versions you want to test against
|
|
14
14
|
os: [ubuntu-latest, windows-latest]
|
|
15
15
|
name: Python ${{ matrix.python-version }} - ${{ matrix.os }}
|
|
16
16
|
runs-on: ${{ matrix.os }}
|
|
@@ -181,19 +181,29 @@ print("mse = " + str(mse_min))
|
|
|
181
181
|
# y_approx = a.evaluate(lam=λ_min) # evaluate the approximation at the training points for the regularisation λ_min
|
|
182
182
|
# y_approx = a.evaluate(X=X_test, lam=λ_min) # evaluate the approximation at the points X_test for the regularisation λ_min
|
|
183
183
|
|
|
184
|
-
# In the following we plot the real and the approximated anova term for the subset u=[
|
|
184
|
+
# In the following we plot the real and the approximated anova term for the subset u=[3]
|
|
185
185
|
|
|
186
|
-
y_eval_anova = a.evaluateANOVAterms(X=X_test, lam=λ_min)
|
|
186
|
+
y_eval_anova = a.evaluateANOVAterms(X=X_test, lam=λ_min) # evaluate all of the ANOVA terms
|
|
187
|
+
pos = a.U.index((3,)) # find the index for the subset u=[3]
|
|
188
|
+
y_eval_anova_3 = y_eval_anova.T[pos]
|
|
187
189
|
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
190
|
+
perm = np.argsort(X_test.T[3])
|
|
191
|
+
X_plot = X_test.T[3][perm]
|
|
192
|
+
y_eval_anova_3_plot = np.real(y_eval_anova_3[perm])
|
|
193
|
+
y_anova_3_plot = -np.exp(np.sin(2*np.pi*X_plot))+1.26607
|
|
191
194
|
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
195
|
+
plt.figure()
|
|
196
|
+
plt.plot(
|
|
197
|
+
X_plot,
|
|
198
|
+
y_eval_anova_3_plot,
|
|
199
|
+
label="approximation"
|
|
200
|
+
)
|
|
201
|
+
plt.plot(
|
|
202
|
+
X_plot,
|
|
203
|
+
y_anova_3_plot,
|
|
204
|
+
label="ANOVA term" # ... "ANOVA term"]
|
|
205
|
+
)
|
|
206
|
+
plt.title("Approximation of the ANOVA term 4") # title = "..."
|
|
207
|
+
plt.legend() # Zeigt die Labels/Legende an
|
|
208
|
+
plt.grid(True, linestyle='--', alpha=0.7)
|
|
209
|
+
plt.show()
|
|
@@ -50,7 +50,7 @@ def get_orderDependentBW(U, N):
|
|
|
50
50
|
else:
|
|
51
51
|
N_bw[i] = N[len(U[i]) - 1]
|
|
52
52
|
|
|
53
|
-
return
|
|
53
|
+
return N_bw
|
|
54
54
|
|
|
55
55
|
|
|
56
56
|
### approx:
|
|
@@ -78,7 +78,7 @@ class approx:
|
|
|
78
78
|
X,
|
|
79
79
|
y,
|
|
80
80
|
U=None,
|
|
81
|
-
N=
|
|
81
|
+
N=None,
|
|
82
82
|
basis="cos",
|
|
83
83
|
classification=False,
|
|
84
84
|
basis_vect=[],
|
|
@@ -86,7 +86,7 @@ class approx:
|
|
|
86
86
|
ds=None,
|
|
87
87
|
):
|
|
88
88
|
|
|
89
|
-
if len(N) == 0:
|
|
89
|
+
if (N == None or len(N) == 0):
|
|
90
90
|
ValueError("please define N")
|
|
91
91
|
|
|
92
92
|
if (
|
|
@@ -95,7 +95,7 @@ class approx:
|
|
|
95
95
|
U = get_superposition_set(X.shape[1], ds)
|
|
96
96
|
|
|
97
97
|
if (
|
|
98
|
-
N
|
|
98
|
+
not isinstance(N[0], list)
|
|
99
99
|
): # setting N #approx( X::Matrix{Float64}, y::Union{Vector{ComplexF64},Vector{Float64}}, U::Vector{Vector{Int}}, N::Vector{Int}, basis::String = "cos"; classification::Bool = false, basis_vect::Vector{String} = Vector{String}([]), fastmult::Bool = classification ? true : false,)
|
|
100
100
|
ds = max(len(u) for u in U)
|
|
101
101
|
|
|
@@ -111,11 +111,14 @@ class approx:
|
|
|
111
111
|
for i in range(len(U)):
|
|
112
112
|
u = U[i]
|
|
113
113
|
if len(u) == 0:
|
|
114
|
-
bws[i] = np.array([0] * len(u),
|
|
114
|
+
bws[i] = np.array([0] * len(u), np.int32)
|
|
115
115
|
else:
|
|
116
|
-
bws[i] = np.array([bw[i]] * len(u),
|
|
116
|
+
bws[i] = np.array([bw[i]] * len(u), np.int32)
|
|
117
117
|
|
|
118
118
|
N = bws
|
|
119
|
+
|
|
120
|
+
else:
|
|
121
|
+
N = [np.array(u, dtype = np.int32) for u in N]
|
|
119
122
|
|
|
120
123
|
if basis_vect is None:
|
|
121
124
|
basis_vect = []
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|