Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
openbis
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
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
sispub
openbis
Commits
58c7d584
Commit
58c7d584
authored
10 years ago
by
jakubs
Browse files
Options
Downloads
Patches
Plain Diff
SSDM-285: treat empty feature values as NaNs if all other values are numerical.
SVN: 31480
parent
53122497
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java
+19
-5
19 additions, 5 deletions
.../cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java
with
19 additions
and
5 deletions
screening/source/java/ch/systemsx/cisd/openbis/dss/etl/featurevector/FeatureValuesMap.java
+
19
−
5
View file @
58c7d584
...
@@ -23,12 +23,13 @@ import java.util.Map;
...
@@ -23,12 +23,13 @@ import java.util.Map;
import
java.util.Map.Entry
;
import
java.util.Map.Entry
;
import
java.util.Set
;
import
java.util.Set
;
import
org.apache.commons.lang.StringUtils
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Geometry
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.api.v1.dto.Geometry
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation
;
import
ch.systemsx.cisd.openbis.plugin.screening.shared.basic.dto.WellLocation
;
/**
/**
* Stores values of one feature for all wells (and optionally one chosen timepoint and/or
* Stores values of one feature for all wells (and optionally one chosen timepoint and/or depth-scan).
* depth-scan).
*
*
* @author Tomasz Pylak
* @author Tomasz Pylak
*/
*/
...
@@ -95,7 +96,7 @@ public class FeatureValuesMap implements Serializable
...
@@ -95,7 +96,7 @@ public class FeatureValuesMap implements Serializable
{
{
WellLocation
wellLocation
=
entry
.
getKey
();
WellLocation
wellLocation
=
entry
.
getKey
();
String
value
=
entry
.
getValue
();
String
value
=
entry
.
getValue
();
float
floatValue
=
Float
.
parseFloat
(
value
);
float
floatValue
=
parseFloat
OrEmptyString
(
value
);
map
.
put
(
wellLocation
,
floatValue
);
map
.
put
(
wellLocation
,
floatValue
);
}
catch
(
NumberFormatException
ex
)
}
catch
(
NumberFormatException
ex
)
{
{
...
@@ -105,9 +106,22 @@ public class FeatureValuesMap implements Serializable
...
@@ -105,9 +106,22 @@ public class FeatureValuesMap implements Serializable
return
map
;
return
map
;
}
}
private
float
parseFloatOrEmptyString
(
String
value
)
{
float
floatValue
;
if
(
StringUtils
.
isBlank
(
value
))
{
floatValue
=
Float
.
NaN
;
}
else
{
floatValue
=
Float
.
parseFloat
(
value
);
}
return
floatValue
;
}
/**
/**
* Assuming that all values come from the set fixed of vocabulary terms calculates the mapping
* Assuming that all values come from the set fixed of vocabulary terms calculates the mapping
from vocabulary term into a unique term sequence
*
from vocabulary term into a unique term sequence
number.<br>
* number.<br>
* Should be called when {@link #tryExtractFloatValues} returns null.
* Should be called when {@link #tryExtractFloatValues} returns null.
*
*
* @return mapping between wells and integer sequence numbers of terms casted to floats
* @return mapping between wells and integer sequence numbers of terms casted to floats
...
...
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