Uploaded image for project: 'Spark'
  1. Spark
  2. SPARK-2163

Set ``setConvergenceTol'' with a parameter of type Double instead of Int

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Implemented
    • Affects Version/s: 1.0.0
    • Fix Version/s: 1.0.1, 1.1.0
    • Component/s: MLlib
    • Labels:
      None

      Description

      The class LBFGS in mllib.optimization currently provides a setConvergenceTol(tolerance: Int) method for setting the convergence tolerance. The tolerance parameter is of type Int. The specified tolerance is then used as parameter in calling LBFGS.runLBFGS, where the parameter convergenceTol is of type Double.

      The Int parameter may cause problem when one creates an optimizer and sets a Double-valued tolerance. e.g:

      override val optimizer = new LBFGS(gradient, updater)
            .setNumCorrections(9)
            .setConvergenceTol(1e-4)  // *type mismatch here*
            .setMaxNumIterations(100)
            .setRegParam(1.0)
      

      IMHO there is no need to make the tolerance of type Int. Let's change it into a Double parameter and eliminate the type mismatch problem.

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              baigang Gang Bai
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: