none
rxRocCurve errors with varsToKeep and varsToDrop not supported for this data source type RRS feed

  • Question

  • Hi all,

    I am executing the SQL Server R Services data science end-to-end walkthrough (https://msdn.microsoft.com/en-us/library/mt629164.aspx)

    When executing the following statement:

    rxRocCurve(actualVarName="tipped", predVarNames="Score", data=scoredOutput)

    I encountered the following error:

    'varsToKeep' and 'varsToDrop' not supported for this data source type. Warning messages: 1: In rocComputeWithTransformObjects(actualVarName = actualVarName, : There are no observations with actual 'TRUE' values. 'sensitivity' cannot be computed. 2: In rocComputeWithTransformObjects(actualVarName = actualVarName, : There are no observations with actual 'FALSE' values. 'specificity' cannot be computed.

    It appears that rxRocCurve is using transform to change the values 0,1 in "tipped" to TRUE / FALSE. However 'varsToKeep' and 'varsToDrop' does not seem to support the data source type of RxSqlServerData data sources.

    Is anyone else experiencing this issue? Is this a bug?

    The only workaround I can think of is to change this to local context. Is this expected?

    Thanks for any replies and help on this!

    Best Regards,

    Ian

    Monday, July 4, 2016 8:18 AM

All replies

  • Ian,

    I got the same error you described, and I'm using SQL R Services 9.x, 9 months after you had this experience. The example walkthrough has not been changed to address this issue, nor has the problem been fixed in rxRocCurve.

    What's different, in my case, is that I had changed the compute context to "local" (same as "RxLocalSeq"), yet I also get this error.

    Then, I noticed this bit of code a little further down, which solved the problem (when compute context is "local") after I moved that code above the call to rxRocCurve.

    # First of all you need to bring the scored Output data to the client using rxImport

    scoredOutput = rxImport(scoredOutput)



    • Edited by Paul M Simpson Friday, April 7, 2017 10:05 PM
    • Proposed as answer by Ian Lo KH Monday, April 10, 2017 12:43 AM
    Friday, April 7, 2017 9:48 PM
  • I had this error and your solution works as well, but that only helps in some small dataset, I am working on massive scale of data and I guess Microsoft do need to have it sorted ASAP...

    thanks again for your solution

    • Proposed as answer by Ian Lo KH Tuesday, September 12, 2017 12:13 AM
    Sunday, April 30, 2017 8:12 AM

  • You have to set the Compute Context e.g. to the remote SQL Server

    cc <- RxInSqlServer(connectionString = connStr, shareDir = sqlShareDir, wait = TRUE, consoleOutput = FALSE)
    rxSetComputeContext(cc)
    rxRocCurve(actualVarName = "left", predVarNames = c("Score"), data = scoredOutput, title = "left predictions AUC")

    or you have to run rxImport() as mentioned above.


    • Edited by alexiori Monday, September 11, 2017 8:28 PM
    • Proposed as answer by Ian Lo KH Tuesday, September 12, 2017 12:13 AM
    Monday, September 11, 2017 8:28 PM