Commons Math
  1. Commons Math
  2. MATH-987

SimpleRegression needs to be map/reducable

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.3
    • Labels:
      None

      Description

      For map/reduce to work with SimpleRegression, there should be a way to add together stats from multiple SimpleRegression objects.

      1. patch
        6 kB
        Ajo Fod

        Activity

        Hide
        Ajo Fod added a comment -

        This includes a method to add SimpleRegression object to an existing one. The test method added asserts that all data updated when a single data point is added are also updated when SimpleRegression objects are added for both the intercept case and the no-intercept case.

        Show
        Ajo Fod added a comment - This includes a method to add SimpleRegression object to an existing one. The test method added asserts that all data updated when a single data point is added are also updated when SimpleRegression objects are added for both the intercept case and the no-intercept case.
        Hide
        Phil Steitz added a comment -

        Thanks for the patch!

        This patch is hard to work with, due to mixing in reformatting with actual code changes. I could not easily extract just the code additions. Can you possibly recreate it without the formatting changes. Basically, you need to turn off the autoreformat in your IDE so you can create a patch that includes only the changes associated with the issue.

        Thanks again for this contribution.

        Show
        Phil Steitz added a comment - Thanks for the patch! This patch is hard to work with, due to mixing in reformatting with actual code changes. I could not easily extract just the code additions. Can you possibly recreate it without the formatting changes. Basically, you need to turn off the autoreformat in your IDE so you can create a patch that includes only the changes associated with the issue. Thanks again for this contribution.
        Hide
        Ajo Fod added a comment -

        Here is the new patch file with formatting removed.

        Show
        Ajo Fod added a comment - Here is the new patch file with formatting removed.
        Hide
        Phil Steitz added a comment -

        Patch applied in r1488849 with the following changes:

        • Changed the name of the new method from addData to append. I understand the rationale for overloading addData here, but the actual parameter is another instance, not just data. I think we should standardize on append for the name of this operation. Will happily change back if others disagree.
        • Moved the "equals" method to the test class and changed it to test reported stats. There is an argument for implementing equals in the class itself, but the problem is the need for the tolerance parameter. We just need it for test for now, so I thought it best to implement an equals with a tolerance parameter in the test class.

        Many thanks for the patch.

        Show
        Phil Steitz added a comment - Patch applied in r1488849 with the following changes: Changed the name of the new method from addData to append. I understand the rationale for overloading addData here, but the actual parameter is another instance, not just data. I think we should standardize on append for the name of this operation. Will happily change back if others disagree. Moved the "equals" method to the test class and changed it to test reported stats. There is an argument for implementing equals in the class itself, but the problem is the need for the tolerance parameter. We just need it for test for now, so I thought it best to implement an equals with a tolerance parameter in the test class. Many thanks for the patch.

          People

          • Assignee:
            Unassigned
            Reporter:
            Ajo Fod
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 4h
              4h
              Remaining:
              Remaining Estimate - 4h
              4h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development