Example #1
0
def main():
    bi.init("Python", "../../../h2o-py/h2o/estimators", clear_dir=False)

    modules = [("deeplearning", "H2OAutoEncoderEstimator", "Unsupervised"),
               ("estimator_base", "H2OEstimator", "Miscellaneous"),
               ("grid_search", "H2OGridSearch", "Miscellaneous"),
               ("automl", "H2OAutoML", "Miscellaneous")]
    builders = filter(
        lambda b: b[0] != 'coxph',
        bi.model_builders().items())  # CoxPH is not supported in Python yet
    for name, mb in builders:
        module = name
        if name == "drf": module = "random_forest"
        if name == "naivebayes": module = "naive_bayes"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.py" % module, gen_module(mb, name))
        category = "Supervised" if mb["supervised"] else "Unsupervised"
        if name in {"svd", "word2vec"}:
            category = "Miscellaneous"
        modules.append((module, algo_to_classname(name), category))

    bi.write_to_file("__init__.py", gen_init(modules))
    bi.write_to_file("../../docs/modeling.rst", gen_models_docs(modules))

    type_adapter1.vprint_translation_map()
Example #2
0
def main():
    bi.init("Python", "../../../h2o-py/h2o/estimators", clear_dir=False)

    modules = [("h2o.estimators.deeplearning", "deeplearning",
                "H2OAutoEncoderEstimator", "Unsupervised"),
               ("h2o.estimators.estimator_base", "estimator_base",
                "H2OEstimator", "Miscellaneous"),
               ("h2o.grid", "grid", "H2OGridSearch", "Miscellaneous"),
               ("h2o.automl", "automl", "H2OAutoML", "Miscellaneous")]
    builders = bi.model_builders().items()
    algo_to_module = dict(drf="random_forest",
                          naivebayes="naive_bayes",
                          isolationforest="isolation_forest",
                          extendedisolationforest="extended_isolation_forest")
    algo_to_category = dict(svd="Miscellaneous", word2vec="Miscellaneous")
    for name, mb in builders:
        module = name
        if name in algo_to_module:
            module = algo_to_module[name]
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.py" % module, gen_module(mb, name))
        category = algo_to_category[name] if name in algo_to_category \
            else "Supervised" if mb["supervised"] \
            else "Unsupervised"
        full_module = '.'.join(["h2o.estimators", module])
        modules.append(
            (full_module, module, algo_to_classname(name), category))

    bi.write_to_file("__init__.py", gen_init(modules))
    bi.write_to_file("../../docs/modeling.rst", gen_models_docs(modules))

    type_adapter1.vprint_translation_map()
Example #3
0
def main():
    bi.init("R", "../../../h2o-r/h2o-package/R", clear_dir=False)

    for name, mb in bi.model_builders().items():
        module = name
        if name == "drf": module = "random_forest"
        if name == "naivebayes": module = "naive_bayes"
        bi.vprint("Generating model: " + name)
        if name == "deepwater" or name == "deeplearning":
            print("Generating model:" + module)
            bi.write_to_file("%s.R" % module, gen_module(mb, name))
Example #4
0
def main():
    bi.init("Python", "python")

    for name, mb in bi.model_builders().items():
        module = name
        if name == "drf": module = "random_forest"
        if name == "naivebayes": module = "naive_bayes"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.py" % module, gen_module(mb, name))

    type_adapter.vprint_translation_map()
Example #5
0
def main():
    bi.init("R", "../../../h2o-r/h2o-package/R", clear_dir=False)

    for name, mb in bi.model_builders().items():
        module = name
        file_name = name
        if name == "drf":
            module = "randomForest"
            file_name = "randomforest"
        if name == "naivebayes": module = "naiveBayes"
        if name == "stackedensemble": module = "stackedEnsemble"
        if name == "pca": module = "prcomp"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.R" % file_name, gen_module(mb, name, module))
Example #6
0
def main():
    bi.init("Python", "../../../h2o-py/h2o/estimators", clear_dir=False)

    modules = [("deeplearning", "H2OAutoEncoderEstimator")]  # deeplearning module contains 2 classes in it...
    for name, mb in bi.model_builders().items():
        module = name
        if name == "drf": module = "random_forest"
        if name == "naivebayes": module = "naive_bayes"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.py" % module, gen_module(mb, name))
        modules.append((module, algo_to_classname(name)))

    bi.write_to_file("__init__.py", gen_init(modules))

    type_adapter.vprint_translation_map()
Example #7
0
def main():
    bi.init("Python", "../../../h2o-py/h2o/estimators", clear_dir=False)

    modules = [("deeplearning", "H2OAutoEncoderEstimator")]  # deeplearning module contains 2 classes in it...
    for name, mb in bi.model_builders().items():
        module = name
        if name == "drf": module = "random_forest"
        if name == "naivebayes": module = "naive_bayes"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.py" % module, gen_module(mb, name))
        modules.append((module, algo_to_classname(name)))

    bi.write_to_file("__init__.py", gen_init(modules))

    type_adapter.vprint_translation_map()
Example #8
0
File: gen_R.py Project: h2oai/h2o-3
def main():
    bi.init("R", "../../../h2o-r/h2o-package/R", clear_dir=False)

    for name, mb in bi.model_builders().items():
        if name in ["aggregator"]:
            continue
        module = name
        file_name = name
        if name == "drf":
            module = "randomForest"
            file_name = "randomforest"
        if name == "naivebayes": module = "naiveBayes"
        if name == "stackedensemble": module = "stackedEnsemble"
        if name == "pca": module = "prcomp"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.R" % file_name, gen_module(mb, name, module))
Example #9
0
def main():
    bi.init("Python", "../../../h2o-py/h2o/estimators", clear_dir=False)

    modules = [("deeplearning", "H2OAutoEncoderEstimator", "Unsupervised"),
               ("estimator_base", "H2OEstimator", "Miscellaneous"),
               ("grid_search", "H2OGridSearch", "Miscellaneous"),
               ("automl", "H2OAutoML", "Miscellaneous")]
    builders = filter(lambda b: b[0] != 'coxph', bi.model_builders().items()) # CoxPH is not supported in Python yet
    for name, mb in builders:
        module = name
        if name == "drf": module = "random_forest"
        if name == "naivebayes": module = "naive_bayes"
        bi.vprint("Generating model: " + name)
        bi.write_to_file("%s.py" % module, gen_module(mb, name))
        category = "Supervised" if mb["supervised"] else "Unsupervised"
        if name in {"svd", "word2vec"}:
            category = "Miscellaneous"
        modules.append((module, algo_to_classname(name), category))

    bi.write_to_file("__init__.py", gen_init(modules))
    bi.write_to_file("../../docs/modeling.rst", gen_models_docs(modules))

    type_adapter1.vprint_translation_map()