class_docstr: Import MOJO Model
class_docstr_tok: ["Import","MOJO","Model"]
docstr: Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO.
  The imported model must be supported by H2O.
  
  :param file: A string containing path to the file to create the model from
  :param model_id: Model ID
  :return: H2OGenericEstimator instance representing the generic model
  
  :examples:
  
  >>> from h2o.estimators import H2OIsolationForestEstimator, H2OGenericEstimator
  >>> import tempfile
  >>> airlines= h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/testng/airlines_train.csv")
  >>> ifr = H2OIsolationForestEstimator(ntrees=1)
  >>> ifr.train(x=["Origin","Dest"], y="Distance", training_frame=airlines)
  >>> original_model_filename = tempfile.mkdtemp()
  >>> original_model_filename = ifr.download_mojo(original_model_filename)
  >>> model = H2OGenericEstimator.from_file(original_model_filename)
  >>> model.model_performance()
docstr_tok: ["Creates","new","Generic","model","by","loading","existing","embedded","model","into","library",",","e.g",".","from","H2O","MOJO",".","The","imported","model","must","be","supported","by","H2O",".",":","param","file",":","A","string","containing","path","to","the","file","to","create","the","model","from",":","param","model_id",":","Model","ID",":","return",":","H2OGenericEstimator","instance","representing","the","generic","model",":","examples",":",">",">",">","from","h2o.estimators","import","H2OIsolationForestEstimator",",","H2OGenericEstimator",">",">",">","import","tempfile",">",">",">","airlines=","h2o.import_file","(","``","https",":","\/\/s3.amazonaws.com\/h2o-public-test-data\/smalldata\/testng\/airlines_train.csv","''",")",">",">",">","ifr","=","H2OIsolationForestEstimator","(","ntrees=1",")",">",">",">","ifr.train","(","x=","[","``","Origin","''",",","''","Dest","''","]",",","y=","''","Distance","''",",","training_frame=airlines",")",">",">",">","original_model_filename","=","tempfile.mkdtemp","(",")",">",">",">","original_model_filename","=","ifr.download_mojo","(","original_model_filename",")",">",">",">","model","=","H2OGenericEstimator.from_file","(","original_model_filename",")",">",">",">","model.model_performance","(",")"]
code: def from_file(file=str, model_id=None):
      """
      Creates new Generic model by loading existing embedded model into library, e.g. from H2O MOJO.
      The imported model must be supported by H2O.
  
      :param file: A string containing path to the file to create the model from
      :param model_id: Model ID
      :return: H2OGenericEstimator instance representing the generic model
  
      :examples:
  
      >>> from h2o.estimators import H2OIsolationForestEstimator, H2OGenericEstimator
      >>> import tempfile
      >>> airlines= h2o.import_file("https://s3.amazonaws.com/h2o-public-test-data/smalldata/testng/airlines_train.csv")
      >>> ifr = H2OIsolationForestEstimator(ntrees=1)
      >>> ifr.train(x=["Origin","Dest"], y="Distance", training_frame=airlines)
      >>> original_model_filename = tempfile.mkdtemp()
      >>> original_model_filename = ifr.download_mojo(original_model_filename)
      >>> model = H2OGenericEstimator.from_file(original_model_filename)
      >>> model.model_performance()
      """
      model = H2OGenericEstimator(path=file, model_id=model_id)
      model.train()
  
      return model
  
file_path: h2o-3/h2o-py/h2o/estimators/generic.py
imports: from h2o.estimators.estimator_base import H2OEstimator
  from h2o.exceptions import H2OValueError
  from h2o.frame import H2OFrame
  from h2o.utils.typechecks import assert_is_type, Enum, numeric
label_desc: Use image node_id 6 for calling the H2OGenericEstimator obj's underlying member method code with example usage: obj.from_file(file, model_id) and returns: model