spark-reviews mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From yanboliang <...@git.apache.org>
Subject [GitHub] spark pull request: [SPARK-13010] [ML] [SparkR] Implement a simple...
Date Tue, 01 Mar 2016 14:49:03 GMT
Github user yanboliang commented on a diff in the pull request:

    https://github.com/apache/spark/pull/11447#discussion_r54576046
  
    --- Diff: mllib/src/main/scala/org/apache/spark/ml/r/SparkRWrappers.scala ---
    @@ -52,6 +53,43 @@ private[r] object SparkRWrappers {
         pipeline.fit(df)
       }
     
    +  def fitAFTSurvivalRegression(
    +      value: String,
    +      df: DataFrame): PipelineModel = {
    +
    +    def formulaRewrite(value: String): (String, String) = {
    +      var rewrited: String = null
    +      var censorCol: String = null
    +
    +      val regex = "^Surv\\(([^,]*),([^,]*)\\)\\s*\\~\\s*(.*)".r
    +      try {
    +        val regex(label, censor, features) = value
    +        // TODO: Support dot operator.
    +        if (features.contains(".")) {
    +          throw new UnsupportedOperationException(
    +            "Terms of survreg formula can not support dot operator.")
    --- End diff --
    
    We will not support dot operator currently, because dot will be expanded to all column
names including the ```censorCol``` which is unexpected. 
    If terms of survreg formula only include ```.```, we can expand it to all feature column
names at here. But if the formula contains ```.:.``` or ```.:x```, we can not handle it here.
So I choose to not support any kind of dot in term.


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

---------------------------------------------------------------------
To unsubscribe, e-mail: reviews-unsubscribe@spark.apache.org
For additional commands, e-mail: reviews-help@spark.apache.org


Mime
View raw message