<commit_before>import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_browse as h2b

class Basic(unittest.TestCase):
    def tearDown(self):
        h2o.check_sandbox_for_errors()

    @classmethod
    def setUpClass(cls):
        global localhost
        localhost = h2o.decide_if_localhost()
        if (localhost):
            h2o.build_cloud(1)
        else:
            h2o_hosts.build_cloud_with_hosts()

    @classmethod
    def tearDownClass(cls):
        h2o.sleep(3600)
        h2o.tear_down_cloud()

    def test_rf_predict_fvec(self):
        h2b.browseTheCloud()
        SYNDATASETS_DIR = h2o.make_syn_dir()

        h2o.beta_features = True
        trees = 6
        timeoutSecs = 20
        hex_key = 'iris2.csv.hex'
        parseResult = h2i.import_parse(bucket='smalldata', path='iris/iris2.csv', schema='put', hex_key=hex_key)
        h2o_cmd.runRF(parseResult=parseResult, ntrees=trees, destination_key="iris_rf_model", timeoutSecs=timeoutSecs)

        print "Use H2O GeneratePredictionsPage with a H2O generated model and the same data key. Inspect/Summary result"

        start = time.time()
        predict = h2o.nodes[0].generate_predictions(model_key="iris_rf_model", data_key=hex_key, 
            prediction='predict.hex')
        print "generate_predictions end on ", hex_key, " took", time.time() - start, 'seconds'<commit_msg>don't sleep<commit_after>import unittest, time, sys
sys.path.extend(['.','..','py'])
import h2o, h2o_cmd, h2o_hosts, h2o_import as h2i, h2o_browse as h2b

class Basic(unittest.TestCase):
    def tearDown(self):
        h2o.check_sandbox_for_errors()

    @classmethod
    def setUpClass(cls):
        global localhost
        localhost = h2o.decide_if_localhost()
        if (localhost):
            h2o.build_cloud(1)
        else:
            h2o_hosts.build_cloud_with_hosts()

    @classmethod
    def tearDownClass(cls):
        # h2o.sleep(3600)
        h2o.tear_down_cloud()

    def test_rf_predict_fvec(self):
        h2b.browseTheCloud()
        SYNDATASETS_DIR = h2o.make_syn_dir()

        h2o.beta_features = True
        trees = 6
        timeoutSecs = 20
        hex_key = 'iris2.csv.hex'
        parseResult = h2i.import_parse(bucket='smalldata', path='iris/iris2.csv', schema='put', hex_key=hex_key)
        h2o_cmd.runRF(parseResult=parseResult, ntrees=trees, destination_key="iris_rf_model", timeoutSecs=timeoutSecs)

        print "Use H2O GeneratePredictionsPage with a H2O generated model and the same data key. Inspect/Summary result"

        start = time.time()
        predict = h2o.nodes[0].generate_predictions(model_key="iris_rf_model", data_key=hex_key, 
            prediction='predict.hex')
        print "generate_predictions end on ", hex_key, " took", time.time() - start, 'seconds'
{'fraction_non_alphanumeric': 0.1086803105151729, 'fraction_numerical': 0.022582921665490474, 'mean_word_length': 3.0327169274537695, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7481243', 'n_tokens_mistral': 1021, 'n_tokens_neox': 977, 'n_words': 180}