Hello. Le lun. 24 janv. 2022 à 08:21, qiqi tang <tangonepiece...@gmail.com> a écrit : > > *HI Gilles Sadowski,* > > > > @Overridepublic double[] fit(Collection<WeightedObservedPoint> points) { > final double[] p = super.fit(points); > return new double[] { > constrainedM.value(p[0]), > constrainedK.value(p[1]), > p[2] > }; > } > > This method Just maps the end result to the range I want.
You've cut several pieces of the suggested code. [Also, please keep this discussion within a unique ML thread.] Did you try the proposed full set of changes? Was the output of the code not a local optimum? The feature you need deserves to be part of the test suite, so you are welcome to file a report on the issue-tracking system (see detailed information on the project's page). You should then rewrite your case in the form of a (JUnit) unit test (see the "test" part of the source repository). > I think I need to > let the return value of the fit method fall within the set range, What do you mean by > let the [...] value [...] fall within the [...] range ? What happens if you don't use the suggested trick? If the value doesn't settle in that range by itself, it means that there are local minima. > rather > than processing the return value of the fit method twice. Just like example: > > @Overridepublic double[] fit(Collection<WeightedObservedPoint> points) { > return super.fit(points);} > > The above method returns a value that is directly in the range of the > parameter variable I want. In your previous message, you asked: > What should I do to limit the parameters 'm' to 1 to 100 and 'k' > to 100 to 10,000 So indeed, bugs notwithstanding, my proposed solution is supposed to reach that goal by assuming that the domain of those parameters are the given ranges. Regards, Gilles --------------------------------------------------------------------- To unsubscribe, e-mail: user-unsubscr...@commons.apache.org For additional commands, e-mail: user-h...@commons.apache.org