Community & Support
Learn
Marketplace
Discussions
Categories
Discussions
General
Platform
Academic
Partner
Regional
User Groups
Documentation
Events
Altair Exchange
Share or Download Projects
Resources
News & Instructions
Programs
YouTube
Employee Resources
This tab can be seen by employees only. Please do not share these resources externally.
Groups
Join a User Group
Support
Altair RISE
A program to recognize and reward our most engaged community members
Nominate Yourself Now!
Home
Discussions
Community Q&A
exampleSet.getExampleFromId returns null
navyboys
I want to retrieve an example object by the "exampleSet.getExampleFromId" method, but got an NullPointerException error, anybody can tell me how to use this method?
Sample source likes this (Simplified Version)
-------------------------------------------------------------------------------------
Set<Double> exampleIds = new HashSet<Double>(exampleSet.size());
for (Example example: exampleSet) {
exampleIds.add(example.getId());
}
for (Double exampleId: exampleIds) {
Example example = exampleSet.getExampleFromId(exampleId);
example.getWeight();
}
-------------------------------------------------------------------------------------
Find more posts tagged with
AI Studio
Developer
Accepted answers
All comments
fischer
Hi,
hard to tell without an error message. Does your example set actually have an id attribute?
Best,
Simon
fischer
oh, and it looks like you did not call ExmpleSet.remapIds().
Best,
Simon
navyboys
Hi, Simon
Problem resolved by adding ExampleSet.remapIds().
Thank you very much.
Yours ZHENG
Quick Links
All Categories
Recent Discussions
Activity
Unanswered
日本語 (Japanese)
한국어(Korean)
Groups