6b4cb961e16a69bce108f49872465329b1e3bcec,methods/mlpy/linear_regression.py,LinearRegression,RunMetrics,#LinearRegression#,111

Before Change


      metrics_dict["Simple MSE"] = SimpleMSE
      return metrics_dict
    else:
      Log.Fatal("This method requires three datasets.")

  """
  Perform Linear Regression. If the method has been successfully completed
  return the elapsed time in seconds.

After Change


  def RunMetrics(self, options):
    Log.Info("Perform Linear regression.", self.verbose)

    results = self.LinearRegressionMlpy(options)
    if results < 0:
      return results

    metrics = {"Runtime" : results}


    if len(self.dataset) >= 2:
      // Check if we need to build and run the model.
      if not CheckFileAvailable("mlpy_lr_predictions.csv"):
        self.RunTiming(options)

      testData = LoadDataset(self.dataset[1])
      truelabels = LoadDataset(self.dataset[2])

      predictedlabels = LoadDataset("mlpy_lr_predictions.csv")

      confusionMatrix = Metrics.ConfusionMatrix(truelabels, predictedlabels)
      AvgAcc = Metrics.AverageAccuracy(confusionMatrix)
      AvgPrec = Metrics.AvgPrecision(confusionMatrix)
      AvgRec = Metrics.AvgRecall(confusionMatrix)
      AvgF = Metrics.AvgFMeasure(confusionMatrix)
      AvfLift = Metrics.LiftMultiClass(confusionMatrix)
      AvgMCC = Metrics.MCCMultiClass(confusionMatrix)
      AvgInformation = Metrics.AvgMPIArray(confusionMatrix, truelabels, predictedlabels)
      SimpleMSE = Metrics.SimpleMeanSquaredError(truelabels, predictedlabels)

      metrics["Avg Accuracy"] = AvgAcc
      metrics["MultiClass Precision"] = AvgPrec
      metrics["MultiClass Recall"] = AvgRec
      metrics["MultiClass FMeasure"] = AvgF
      metrics["MultiClass Lift"] = AvgLift
      metrics["MultiClass MCC"] = AvgMCC
      metrics["MultiClass Information"] = AvgInformation
      metrics["Simple MSE"] = SimpleMSE

    return metrics
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 8

Instances


Project Name: mlpack/benchmarks
Commit Name: 6b4cb961e16a69bce108f49872465329b1e3bcec
Time: 2016-07-11
Author: marcus.edel@fu-berlin.de
File Name: methods/mlpy/linear_regression.py
Class Name: LinearRegression
Method Name: RunMetrics


Project Name: mlpack/benchmarks
Commit Name: 0412c274d494a63090d8acd15f1cf97f7791cbcc
Time: 2016-07-11
Author: marcus.edel@fu-berlin.de
File Name: methods/shogun/lasso.py
Class Name: LASSO
Method Name: RunMetrics


Project Name: mlpack/benchmarks
Commit Name: 0412c274d494a63090d8acd15f1cf97f7791cbcc
Time: 2016-07-11
Author: marcus.edel@fu-berlin.de
File Name: methods/shogun/logistic_regression.py
Class Name: LogisticRegression
Method Name: RunMetrics


Project Name: mlpack/benchmarks
Commit Name: 0412c274d494a63090d8acd15f1cf97f7791cbcc
Time: 2016-07-11
Author: marcus.edel@fu-berlin.de
File Name: methods/shogun/linear_regression.py
Class Name: LinearRegression
Method Name: RunMetrics