Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make sure number of clusters in misfit preprocessor is at least 1 #9672

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Prev Previous commit
Next Next commit
Go above threshold when setting cluster number
  • Loading branch information
larsevj committed Jan 20, 2025
commit 61415c95dca300e0b1a02f01291441ad2848d160
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


def cluster_responses(
Expand Down