Skip to content

Commit

Permalink
Raise Exception in LAR
Browse files Browse the repository at this point in the history
A special case of constant function identified by LAR, raise the exception
  • Loading branch information
NovakLBUT authored Apr 7, 2022
1 parent 03143d3 commit 3680ef6
Showing 1 changed file with 3 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def model_selection(pce_object: PolynomialChaosExpansion, target_error=1, check_
overfitting = False
BestLarsError = 0
step = 0

if steps<3:
raise Exception('LAR identified constant function! Check your data.')

while BestLarsError < target_error and step < steps - 2 and overfitting == False:

Expand Down

0 comments on commit 3680ef6

Please sign in to comment.