Skip to content

Commit

Permalink
Go above threshold when setting cluster number
Browse files Browse the repository at this point in the history
  • Loading branch information
larsevj committed Jan 8, 2025
1 parent 0dc3f2f commit ae99afd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/ert/analysis/misfit_preprocessor.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def get_nr_primary_components(
# We compute the cumulative sum of these, then divide by their total sum to get the
# cumulative proportion of variance explained by each successive component.
variance_ratio = np.cumsum(singulars**2) / np.sum(singulars**2)
return max(len([1 for i in variance_ratio if i < threshold]), 1)
return np.argmax(variance_ratio >= threshold) + 1

Check failure on line 45 in src/ert/analysis/misfit_preprocessor.py

View workflow job for this annotation

GitHub Actions / type-checking (3.12)

Incompatible return value type (got "signedinteger[Any]", expected "int")


def cluster_responses(
Expand Down

0 comments on commit ae99afd

Please sign in to comment.