Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
BayesValidRox
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
inversemodeling
BayesValidRox
Commits
5bc22b77
Commit
5bc22b77
authored
2 months ago
by
kohlhaasrebecca
Browse files
Options
Downloads
Patches
Plain Diff
Remove test_adaptive_regression_fewsamples
parent
3cf03c33
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!50
Resolve "Add n_init_samples to ExpDesign constructor"
Pipeline
#53363
passed
2 months ago
Stage: test
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test_PolynomialChaosEmulator.py
+15
-15
15 additions, 15 deletions
tests/test_PolynomialChaosEmulator.py
with
15 additions
and
15 deletions
tests/test_PolynomialChaosEmulator.py
+
15
−
15
View file @
5bc22b77
...
...
@@ -614,24 +614,24 @@ def test_univ_basis_vals(PCE_1DwithInputSpace) -> None:
#%% Test PCE.adaptive_regression
def
test_adaptive_regression_fewsamples
(
PCE_1DwithInputSpace
)
->
None
:
"""
Adaptive regression, no specific method, too few samples given
"""
mm
=
PCE_1DwithInputSpace
samples
=
np
.
array
([[
0.2
]])
outputs
=
np
.
array
([
0.8
])
#
def test_adaptive_regression_fewsamples(PCE_1DwithInputSpace) -> None:
#
"""
#
Adaptive regression, no specific method, too few samples given
#
"""
#
mm = PCE_1DwithInputSpace
#
samples = np.array([[0.2]])
#
outputs = np.array([0.8])
##
mm
.
CollocationPoints
=
samples
mm
.
build_metamodel
()
#
mm.CollocationPoints = samples
#
mm.build_metamodel()
#
# Evaluate the univariate polynomials on InputSpace
mm
.
univ_p_val
=
mm
.
univ_basis_vals
(
mm
.
CollocationPoints
)
#
# Evaluate the univariate polynomials on InputSpace
#
mm.univ_p_val = mm.univ_basis_vals(mm.CollocationPoints)
with
pytest
.
raises
(
AttributeError
)
as
excinfo
:
mm
.
adaptive_regression
(
samples
,
outputs
,
0
)
assert
str
(
excinfo
.
value
)
==
(
'
There are too few samples for the corrected loo-cv error. Fit surrogate on at least as
'
'
many samples as parameters to use this
'
)
#
with pytest.raises(AttributeError) as excinfo:
#
mm.adaptive_regression(samples, outputs, 0)
#
assert str(excinfo.value) == ('There are too few samples for the corrected loo-cv error. Fit surrogate on at least as '
#
'many samples as parameters to use this')
def
test_adaptive_regression
(
PCE_1DwithInputSpace
)
->
None
:
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment