locked
Creating an outfrom from an R script throws an exception RRS feed

  • Question

  • I have a R script that I am trying to implement on Azure ML.  The last 2 lines of the original script is this:

    result <- data.frame(rbind(cat2, cat1))
    (result$Category, result$Y)

    I want this module to output the result to be used as the input of a scoring module.  To that end, I rewrote the last lines like this:

    result <- data.frame(rbind(cat2, cat1))
    outTable <- table(result$Category, result$Y)
    outframe <-as.data.frame(as.integer(serialize(outTable,connection=NULL)))

    However, I am getting this exception

    [ModuleOutput]   DllModuleHost Error: 1 : Program::Main encountered fatal exception: Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException: Error 0063: The following error occurred during evaluation of R script:
    [ModuleOutput] ---------- Start of error message from R ----------

    Can someone assist?

    Tuesday, October 14, 2014 10:55 PM

Answers

  • That should be

    maml.mapOutputPort, rather than MapOutputPort

    AK

    EDIT: also tcltk2, caret, and randomForest are already pre-installed, if that helps

    AK

    Wednesday, October 15, 2014 6:32 PM

All replies

  • Hey Jamie,

    Could you post the full output log? The error from R is usually in there just a bit above what you pasted.

    Thanks,

    AK

    Tuesday, October 14, 2014 10:57 PM
  • I tried a bunch of different variations.  Here is the most recent 

    result <- data.frame(rbind(cat2, cat1))
    outTable <-table(result$Category, result$Y)
    maml.MapOutputPort("outTable")

    and the full output log is below:

    Record Starts at UTC 10/14/2014 23:28:16:

    Run the job:"/dll "ExecuteRScript, Version=5.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset"  /dataset1 "..\..\Dataset1\Dataset1.dataset"   /dataset2 "..\..\Dataset2\Dataset2.dataset"   /bundlePath "..\..\Script Bundle\Script Bundle.zip"  /rStreamReader "script.R"  "
    Starting process 'D:\Program Files\Microsoft Analytics Framework\v5.0\bin\DllModuleHost.exe' with arguments ' /dll "ExecuteRScript, Version=5.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run" /Output0 "..\..\Result Dataset\Result Dataset.dataset" /Output1 "..\..\R Device\R Device.dataset"  /dataset1 "..\..\Dataset1\Dataset1.dataset"   /dataset2 "..\..\Dataset2\Dataset2.dataset"   /bundlePath "..\..\Script Bundle\Script Bundle.zip"  /rStreamReader "script.R"  '
    [ModuleOutput] DllModuleHost Start: 1 : Program::Main
    [ModuleOutput]   DllModuleHost Start: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString
    [ModuleOutput]   DllModuleHost Stop: 1 : DataLabModuleDescriptionParser::ParseModuleDescriptionString. Duration: 00:00:00.0051469
    [ModuleOutput]   DllModuleHost Start: 1 : DllModuleMethod::DllModuleMethod
    [ModuleOutput]   DllModuleHost Stop: 1 : DllModuleMethod::DllModuleMethod. Duration: 00:00:00.0000643
    [ModuleOutput]   DllModuleHost Start: 1 : DllModuleMethod::Execute
    [ModuleOutput]     DllModuleHost Start: 1 : DataLabModuleBinder::BindModuleMethod
    [ModuleOutput]       DllModuleHost Verbose: 1 : moduleMethodDescription ExecuteRScript, Version=5.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca;Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript;Run
    [ModuleOutput]       DllModuleHost Verbose: 1 : assemblyFullName ExecuteRScript, Version=5.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
    [ModuleOutput]       DllModuleHost Start: 1 : DataLabModuleBinder::LoadModuleAssembly
    [ModuleOutput]         DllModuleHost Verbose: 1 : Trying to resolve assembly : ExecuteRScript, Version=5.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
    [ModuleOutput]         DllModuleHost Verbose: 1 : Loaded moduleAssembly ExecuteRScript, Version=5.0.0.0, Culture=neutral, PublicKeyToken=69c3241e6f0468ca
    [ModuleOutput]       DllModuleHost Stop: 1 : DataLabModuleBinder::LoadModuleAssembly. Duration: 00:00:00.0181698
    [ModuleOutput]       DllModuleHost Verbose: 1 : moduleTypeName Microsoft.MetaAnalytics.RDataSupport.ExecuteRScript
    [ModuleOutput]       DllModuleHost Verbose: 1 : moduleMethodName Run
    [ModuleOutput]       DllModuleHost Information: 1 : Module FriendlyName : Execute R Script
    [ModuleOutput]       DllModuleHost Information: 1 : Module Release Status : Release
    [ModuleOutput]     DllModuleHost Stop: 1 : DataLabModuleBinder::BindModuleMethod. Duration: 00:00:00.0221444
    [ModuleOutput]     DllModuleHost Start: 1 : ParameterArgumentBinder::InitializeParameterValues
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos count = 5
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[0] name = dataset1 , type = Microsoft.Numerics.Data.Local.DataTable
    [ModuleOutput]       DllModuleHost Start: 1 : DataTableDatasetHandler::HandleArgumentString
    [ModuleOutput]       DllModuleHost Stop: 1 : DataTableDatasetHandler::HandleArgumentString. Duration: 00:00:00.2843775
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[1] name = dataset2 , type = Microsoft.Numerics.Data.Local.DataTable
    [ModuleOutput]       DllModuleHost Start: 1 : DataTableDatasetHandler::HandleArgumentString
    [ModuleOutput]       DllModuleHost Stop: 1 : DataTableDatasetHandler::HandleArgumentString. Duration: 00:00:00.0047904
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[2] name = bundlePath , type = System.String
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[3] name = rStreamReader , type = System.IO.StreamReader
    [ModuleOutput]       DllModuleHost Verbose: 1 : parameterInfos[4] name = seed , type = System.Nullable`1[System.Int32]
    [ModuleOutput]       DllModuleHost Verbose: 1 : Set optional parameter seed value to NULL
    [ModuleOutput]     DllModuleHost Stop: 1 : ParameterArgumentBinder::InitializeParameterValues. Duration: 00:00:00.3017016
    [ModuleOutput]     DllModuleHost Verbose: 1 : Begin invoking method Run ... 
    [ModuleOutput] Microsoft Drawbridge Console Host [Version 1.0.2108.0]
    [ModuleOutput] [1] 14000
    [ModuleOutput] 
    [ModuleOutput] The following files have been unzipped for sourcing in path=["src"]:
    [ModuleOutput] 
    [ModuleOutput]                      Name  Length                Date
    [ModuleOutput] 
    [ModuleOutput] 1           AUC_0.3.0.zip   44583 2014-09-28 08:17:00
    [ModuleOutput] 
    [ModuleOutput] 2        caret_6.0-35.zip 3793015 2014-09-28 08:18:00
    [ModuleOutput] 
    [ModuleOutput] 3          pROC_1.7.3.zip  781492 2014-09-28 08:17:00
    [ModuleOutput] 
    [ModuleOutput] 4 randomForest_4.6-10.zip  176432 2014-09-28 08:18:00
    [ModuleOutput] 
    [ModuleOutput] 5       tcltk2_1.2-10.zip 1075680 2014-09-28 08:17:00
    [ModuleOutput] 
    [ModuleOutput] Loading objects:
    [ModuleOutput] 
    [ModuleOutput]   port1
    [ModuleOutput] 
    [ModuleOutput]   port2
    [ModuleOutput] 
    [ModuleOutput] [1] "Loading variable port1..."
    [ModuleOutput] 
    [ModuleOutput] [1] "Loading variable port2..."
    [ModuleOutput] 
    [ModuleOutput] package 'AUC' successfully unpacked and MD5 sums checked
    [ModuleOutput] 
    [ModuleOutput] package 'caret' successfully unpacked and MD5 sums checked
    [ModuleOutput] 
    [ModuleOutput] package 'pROC' successfully unpacked and MD5 sums checked
    [ModuleOutput] 
    [ModuleOutput] package 'randomForest' successfully unpacked and MD5 sums checked
    [ModuleOutput] 
    [ModuleOutput] AUC 0.3.0
    [ModuleOutput] 
    [ModuleOutput] Type AUCNews() to see the change log and ?AUC to get an overview.
    [ModuleOutput] 
    [ModuleOutput] Loading required package: lattice
    [ModuleOutput] 
    [ModuleOutput] Loading required package: ggplot2
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] Attaching package: 'caret'
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] The following objects are masked from 'package:AUC':
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput]     sensitivity, specificity
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] Type 'citation("pROC")' for a citation.
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] Attaching package: 'pROC'
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] The following objects are masked from 'package:AUC':
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput]     auc, roc
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] The following objects are masked from 'package:stats':
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput]     cov, smooth, var
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] 
    [ModuleOutput] randomForest 4.6-10
    [ModuleOutput] 
    [ModuleOutput] Type rfNews() to see new features/changes/bug fixes.
    [ModuleOutput] 
    [ModuleOutput] Loading required package: tcltk
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  13.66%  3.56% 63.98%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  13.47%  3.33% 63.98%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  13.82%  3.60% 64.80%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  13.82%  3.53% 65.13%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  13.66%  3.40% 64.80%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  10.20%  3.23% 44.90%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  10.17%  3.37% 44.08%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  10.28%  3.37% 44.74%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  10.00%  3.17% 44.08%
    [ModuleOutput] 
    [ModuleOutput] ntree      OOB      1      2
    [ModuleOutput] 
    [ModuleOutput]   100:  10.03%  3.10% 44.57%
    [ModuleOutput] 
    [ModuleOutput]         predictor
    [ModuleOutput] 
    [ModuleOutput] observed   N   Y
    [ModuleOutput] 
    [ModuleOutput]        N 126   4
    [ModuleOutput] 
    [ModuleOutput]        Y  14   4
    [ModuleOutput] 
    [ModuleOutput] Area under the curve: 0.7604
    [ModuleOutput] 
    [ModuleOutput]          
    [ModuleOutput] 
    [ModuleOutput]            Y Predicted_Y
    [ModuleOutput] 
    [ModuleOutput]   >50%     4           7
    [ModuleOutput] 
    [ModuleOutput]   0%-5%    2          58
    [ModuleOutput] 
    [ModuleOutput]   25%-50%  6          22
    [ModuleOutput] 
    [ModuleOutput]   5%-25%   6          61
    [ModuleOutput] 
    [ModuleOutput]         predictor
    [ModuleOutput] 
    [ModuleOutput] observed    N    Y
    [ModuleOutput] 
    [ModuleOutput]        N 1040   19
    [ModuleOutput] 
    [ModuleOutput]        Y   68   36
    [ModuleOutput] 
    [ModuleOutput] Area under the curve: 0.8376
    [ModuleOutput] 
    [ModuleOutput]          
    [ModuleOutput] 
    [ModuleOutput]             Y Predicted_Y
    [ModuleOutput] 
    [ModuleOutput]   >50%     35          54
    [ModuleOutput] 
    [ModuleOutput]   0%-5%    13         639
    [ModuleOutput] 
    [ModuleOutput]   25%-50%  21         115
    [ModuleOutput] 
    [ModuleOutput]   5%-25%   35         355
    [ModuleOutput] 
    [ModuleOutput]         predictor
    [ModuleOutput] 
    [ModuleOutput] observed    N    Y
    [ModuleOutput] 
    [ModuleOutput]        N 1166   23
    [ModuleOutput] 
    [ModuleOutput]        Y   82   40
    [ModuleOutput] 
    [ModuleOutput] Area under the curve: 0.8313
    [ModuleOutput] 
    [ModuleOutput] Error in eval(expr, envir, enclos) : 
    [ModuleOutput] 
    [ModuleOutput]   could not find function "maml.MapOutputPort"
    [ModuleOutput] 
    [ModuleOutput] In addition: Warning messages:
    [ModuleOutput] 
    [ModuleOutput] 1: In strptime(x, format, tz = tz) :
    [ModuleOutput] 
    [ModuleOutput]   unable to identify current timezone 'C':
    [ModuleOutput] 
    [ModuleOutput] please set environment variable 'TZ'
    [ModuleOutput] 
    [ModuleOutput] 2: In strptime(x, format, tz = tz) : unknown timezone 'localtime'
    [ModuleOutput] 
    [ModuleOutput] 3: package 'AUC' was built under R version 3.1.1 
    [ModuleOutput] 
    [ModuleOutput] 4: package 'caret' was built under R version 3.1.1 
    [ModuleOutput] 
    [ModuleOutput] 5: package 'pROC' was built under R version 3.1.1 
    [ModuleOutput] 
    [ModuleOutput] 6: package 'randomForest' was built under R version 3.1.1 
    [ModuleOutput] 
    [ModuleOutput] 7: In eval(expr, envir, enclos) : NAs introduced by coercion
    [ModuleOutput] 
    [ModuleOutput] 8: In eval(expr, envir, enclos) : NAs introduced by coercion
    [ModuleOutput] 
    [ModuleOutput]   DllModuleHost Stop: 1 : DllModuleMethod::Execute. Duration: 00:01:17.1664894
    [ModuleOutput]   DllModuleHost Error: 1 : Program::Main encountered fatal exception: Microsoft.Analytics.Exceptions.ErrorMapping+ModuleException: Error 0063: The following error occurred during evaluation of R script:
    [ModuleOutput] ---------- Start of error message from R ----------
    [ModuleOutput] R script execution failed. Please click on "View Output Log" in the properties pane for full details.
    [ModuleOutput] ----------- End of error message from R -----------
    Module finished after a runtime of 00:01:17.2485989 with exit code -2
    Module failed due to negative exit code of -2

    Record Ends at UTC 10/14/2014 23:29:34.

    Wednesday, October 15, 2014 6:29 PM
  • That should be

    maml.mapOutputPort, rather than MapOutputPort

    AK

    EDIT: also tcltk2, caret, and randomForest are already pre-installed, if that helps

    AK

    Wednesday, October 15, 2014 6:32 PM