示例#1
0
    def __init__(self, model):
        self.model = model
        self.interpreter = interpreters.RInterpreter()

        assembler_cls = assemblers.get_assembler_cls(model)
        self.model_ast = assembler_cls(model).assemble()

        self._r = "Rscript"
示例#2
0
文件: r.py 项目: akashmavle5/m2cgen
    def __init__(self, model):
        self.model_name = "score"
        self.model = model
        self.interpreter = interpreters.RInterpreter()

        assembler_cls = assemblers.get_assembler_cls(model)
        self.model_ast = assembler_cls(model).assemble()

        self.script_path = None
示例#3
0
文件: exporters.py 项目: mrshu/m2cgen
def export_to_r(model, indent=4):
    """
    Generates a R code representation of the given model.

    Parameters
    ----------
    model : object
        The model object that should be transpiled into code.
    indent : int, optional
        The size of indents in the generated code.

    Returns
    -------
    code : string
    """
    interpreter = interpreters.RInterpreter(indent=indent)
    return _export(model, interpreter)