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

fix occurrence of NaNs due to bug in variable validation #2079

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2018, 2024 Lablicate Gmbh.
* Copyright (c) 2018, 2025 Lablicate Gmbh.
*
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
Expand Down Expand Up @@ -44,7 +44,7 @@ public void replaceZeroColsWithSmallRandom() {
randCol.set(i, 0, rand.nextDouble(1.e-20, 1.e-19));
}
for(int i = 0; i < matrix.numCols; i++) {
if(colSums.get(i) == 0) {
if(colSums.get(i) == 0 || Double.isNaN(colSums.get(i))) {
CommonOps_DDRM.insert(randCol, matrix, 0, i);
}
}
Expand All @@ -53,6 +53,7 @@ public void replaceZeroColsWithSmallRandom() {
@Override
public void compute() {

replaceZeroColsWithSmallRandom();
// Prepare data, E, p, t, threshold, scores, loadings
int numberOfSamples = getSampleData().getNumRows();
int numberOfVariables = getSampleData().getNumCols();
Expand Down