Extend MissingVelueReplenishment with median calculations

User: "der_maik81"
New Altair Community Member
Updated by Jocelyn
Hello Folks,

I want to extend the operator "mssingValueReplenishment" with the possibility to calculate the median of a given attribute. I dont't really know how to start my coding.

Here the steps i did so far:

1) Extend the cases in
                                        MissingValueReplenishment.public double getReplenishmentValue(int functionIndex, ExampleSet exampleSet, Attribute                attribute, double currentValue, String valueString)  with

case MEDIAN:
return exampleSet.getStatistics(attribute, Statistics.MEDIAN);

2) In addition to that in the interface "statistics"  i'have added

public static final String MEDIAN  = "median"

The attributes in my exampleSet are numerical by nature, so i think the key to solving my problem belongs to

3) NumericalStatistics.count(Attribute a) - Here the variance and the mean are calculated for the given attribute.
But now I don't know to go on.

I would be glad if someone has a tip how to proceed.

Thanks very much an best wishes,
Maik


Find more posts tagged with