mahout-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (MAHOUT-1962) Add F-test to Linear Regression Fitness Tests
Date Wed, 03 May 2017 19:14:04 GMT

    [ https://issues.apache.org/jira/browse/MAHOUT-1962?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15995465#comment-15995465
] 

ASF GitHub Bot commented on MAHOUT-1962:
----------------------------------------

Github user rawkintrevo commented on a diff in the pull request:

    https://github.com/apache/mahout/pull/300#discussion_r114629530
  
    --- Diff: math-scala/src/main/scala/org/apache/mahout/math/algorithms/regression/tests/FittnessTests.scala
---
    @@ -47,10 +52,44 @@ object FittnessTests {
     
       // https://en.wikipedia.org/wiki/Mean_squared_error
       def MeanSquareError[R[K] <: RegressorModel[K], K](model: R[K], residuals: DrmLike[K]):
R[K] = {
    +    // TODO : I think mse denom should be (row - col) ??
         val mse = residuals.assign(SQUARE).sum / residuals.nrow
         model.mse = mse
         model.testResults += ('mse -> mse)
         model.summary += s"\nMean Squared Error: ${mse}"
         model
       }
    +
    +  // https://en.wikipedia.org/wiki/xxxx
    +  def FTest[R[K] <: RegressorModel[K], K](model: R[K],  drmFeatures: DrmLike[K], drmTarget:
DrmLike[K]): R[K] = {
    +
    +    // This is the residual sum of squares for just the intercept
    +    //println(" drmTarget.ncol) = " +  drmTarget.ncol)
    +    val interceptCol = drmTarget.ncol - 1
    +    //val targetMean: Double = drmTarget
    +    val targetMean: Double = drmTarget.colMeans().get(0)
    +
    +    val rssint: Double = ((drmTarget - targetMean  ).t %*% (drmTarget - targetMean)).zSum()
    +    // ete above is the RSS for the calculated model
    +
    +    //println(" model.beta(0) = " +  model.beta(0))
    +    //println(" model.beta(interceptCol) = " +  model.beta(interceptCol))
    +    //println("rssint = " + rssint)
    +    //println("rssmod = " + rssmod)
    --- End diff --
    
    get rid of these.


> Add F-test to Linear Regression  Fitness Tests
> ----------------------------------------------
>
>                 Key: MAHOUT-1962
>                 URL: https://issues.apache.org/jira/browse/MAHOUT-1962
>             Project: Mahout
>          Issue Type: Improvement
>          Components: Algorithms
>    Affects Versions: 0.12.0, 0.12.1, 0.13.0, 0.12.2
>            Reporter: Dustin VanStee
>            Priority: Minor
>              Labels: beginner
>             Fix For: 0.13.1
>
>   Original Estimate: 96h
>  Remaining Estimate: 96h
>
> This update will modify org.apache.mahout.math.algorithms.regression.tests.FittnessTests.scala
and add an overall Ftest for significance of one or more parameters being not equal to zero.



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)

Mime
View raw message