none
Unable to calculate ROC in Spark Context? RRS feed

  • Question

  • I'm going through the code in the Exam Ref book for 70-774 for the Microsoft R Server section, <g class="gr_ gr_112 gr-alert gr_gramm gr_inline_cards gr_run_anim Punctuation only-ins replaceWithoutSep" data-gr-id="112" id="112">however</g> after training my model and attempting to use the `rxRoc` or `<g class="gr_ gr_85 gr-alert gr_spell gr_inline_cards gr_run_anim ContextualSpelling ins-del multiReplace" data-gr-id="85" id="85">rxRocCurve</g>` functions I get the below error:

    Error in rxRoc(actualVarName, predVarNames = predVarNames, data = data,  : 
      ROC computations not supported for this compute context.
    

    Here's the code that creates the model and generates the error:

    model.logit <- rxLogit(formula = tipped ~ VendorID + passenger_count + trip_distance
      + payment_type, data = trainXDF)
    
    rxPredict(model.logit, data = testXDF, outData = predsXDF, predVarNames =
        "tipped_pred_logit", extraVarsToWrite = "tipped", overwrite = TRUE)
    
    # Evaluate Model
    roc <- rxRocCurve(actualVarName = "tipped", predVarNames = c("tipped_pred_logit"),
        data = predsXDF)
    

    Am I doing something wrong or has this code changed since this part was written?

    Friday, March 23, 2018 9:39 AM

All replies

  • I believe that this issue is a current limitation in running in Spark compute context.

    Their is an easy workaround however, just switching the compute context before running the above code:

    rxSetComputeContext(RxLocalParallel())

    Friday, March 23, 2018 7:52 PM