manuparra/oc2dm

Strong validation on R Wrapper

Closed this issue · 1 comments

Validate all fault points:

In this example:

ro.r("""
        dataset = read.csv(file="{0}", header = TRUE)
        resultfit = lm(formula="{1}", data=dataset,{2})
        save(resultfit, file="{3}")
        ... Add PMML GENERATE...
     """.format(dataset, formula, inputparameters, output))

Possible fault points are:

  • Reading the DataSet (remember dc:// path ):
    • What if dataset is not available
    • What if dataset has not HEADER,
    • What if formula doesn't contain columns in the dataset,
    • more ...
  • LM function lm(.... :
    • Formula is not correct
    • Formula contains fields not in dataset
    • Function lm return ERROR ? or OKAY (a model)?
    • more ...
  • Save result and PMML generate:
    • resultfit is OKAY (a model) or is an error?
    • file is okay and can be stored ?
    • more ...

Done.