The Altair Community is migrating to a new platform to provide a better experience for you. In preparation for the migration, the Altair Community is on read-only mode from October 28 - November 6, 2024. Technical support via cases will continue to work as is. For any urgent requests from Students/Faculty members, please submit the form linked here
"[SOLVED] sampling a number of examples from different groups"
Dear community,
is it possible to make a sample of let's say 50 examples from every from different groups, that are created through different attributes?
For example i have the attribute a with values 1, 2 and 3 and attribute b with values 1, 2 and 3. The groups that are built through the different combinations have a different amount of data. How can i get a sample with the same amount of examples from every group.
I already tried to use the multiply operator and then different filter operator, but i have so many groups, that this would take days to build...
Thanks for your help
is it possible to make a sample of let's say 50 examples from every from different groups, that are created through different attributes?
For example i have the attribute a with values 1, 2 and 3 and attribute b with values 1, 2 and 3. The groups that are built through the different combinations have a different amount of data. How can i get a sample with the same amount of examples from every group.
I already tried to use the multiply operator and then different filter operator, but i have so many groups, that this would take days to build...
Thanks for your help
Tagged:
0
Answers
your base idea is good and you can follow it: filter the example set by groups with the help of Filter Examples, apply the sampling, and then append the data from all groups.
A chain of Loop Values operators will prevent you from creating the filter for each group manually. This process is still not trivial, but once setup, you can even add new groups to your data without the need to update the process.
Best, Marius
would you perhaps give me a small example how i can use this loop value operator for this problem as i do not understand how to use it...
thanks
The aggregation operator in the end is only to prove that you have 3 examples of each combination of att1 and att2.
You will get problems if a group contains less than (in this case) 3 examples. You could use the Branch operator to check that you have at least group_size examples and only apply the sampling in that case.
Down there you'll find the code.
All the best,
Marius
thank you very much for your very helpful example!
It's great you can solve this problem with RM, for which even SPSS seems not to have a solution...