commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Nguyen <>
Subject [GSoC][Regression][OLS] RegressionResults/OLSResults Re-design
Date Tue, 23 Jul 2019 18:31:22 GMT

Issue was noticed as a PMD violation during PR’s Travis CI build.
“The class 'OLSResults' is suspected to be a Data Class (WOC=20.000%, NOPA=0, NOAM=4, WMC=6)”

UML for current design:

The current design is my (probably wrong) interpretation on a suggestion from Eric Barnhill.

The idea is that all calculation functionality is done in the OLSRegression class, which passes
itself to the OLSResults constructor via regress() method.
The OLSResults (implementing RegressionResults interface) calls on statistics calculating
methods from OLSRegression and saves it as private fields with getters.
I am thinking this is good for users who want everything to be calculated only once to then
be used multiple times (without the recalculation or having to save all statistics themselves).
The RegressionResults interface could also include some kind of output method to get all statistics
in a file or displayed?
Then, for those who only want a single calculated statistic, the methods to calculate in OLSRegression
are also public.

This design does cause that PMD error, so any suggestions or alternate designs to correct
my interpretation?

Thank you,
-Ben Nguyen

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message