<commit_before>import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i
from h2o_test import dump_json, verboseprint, OutputObj

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

    @classmethod
    def setUpClass(cls):
        h2o.init(1, java_heap_GB=4)

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

    def test_GBM_airlines(self):
        files = [
                 ('datasets', 'airlines_all.csv', 'airlines_all.hex', 1800, 'IsDepDelayed')
                ]

        for importFolderPath, csvFilename, trainKey, timeoutSecs, response in files:
            # PARSE train****************************************
            csvPathname = importFolderPath + "/" + csvFilename

            model_key = 'GBMModelKey'
            parseResult = h2i.import_parse(path=csvPathname, schema='hdfs', hex_key=trainKey, timeoutSecs=timeoutSecs)

            pA = h2o_cmd.ParseObj(parseResult)
            iA = h2o_cmd.InspectObj(pA.parse_key)
            parse_key = pA.parse_key
            numRows = iA.numRows
            numCols = iA.numCols
            labelList = iA.labelList

            labelListUsed = list(labelList)
            numColsUsed = numCols

            parameters = {
                'validation_frame': trainKey,
                'ignored_columns': 'CRSDepTime,CRSArrTime,ActualElapsedTime,CRSElapsedTime,AirTime,ArrDelay,DepDelay,TaxiIn,TaxiOut,Cancelled,CancellationCode,Diverted,CarrierDelay,WeatherDelay,NASDelay,SecurityDelay,LateAircraftDelay,IsArrDelayed',
                'score_each_iteration': True,
                'response_column': response,
                'do_classification': True,
                # 'balance_classes':
                # 'max_after_balance_size':
                'ntrees': 2,
                'max_depth': 10,
                'min_rows': 3,
                'nbins': 40,
                'learn_rate': 0.2,
                # FIX! doesn't like it?
                # 'loss': 'Bernoulli',
                # FIX..no variable importance for GBM yet?
                'variable_importance': False,
                # 'seed': 
            }

            bmResult = h2o.n0.build_model(<commit_msg>this runs till the GBM<commit_after>import unittest, sys, time
sys.path.extend(['.','..','../..','py'])
import h2o, h2o_cmd, h2o_import as h2i
from h2o_test import dump_json, verboseprint, OutputObj

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

    @classmethod
    def setUpClass(cls):
        h2o.init(1, use_hdfs=True, hdfs_version='cdh5', hdfs_name_node='172.16.2.180', java_heap_GB=12)


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

    def test_GBM_airlines(self):
        files = [
                 ('datasets', 'airlines_all.csv', 'airlines_all.hex', 1800, 'IsDepDelayed')
                ]

        for importFolderPath, csvFilename, trainKey, timeoutSecs, response in files:
            # PARSE train****************************************
            csvPathname = importFolderPath + "/" + csvFilename

            model_key = 'GBMModelKey'
            parseResult = h2i.import_parse(path=csvPathname, schema='hdfs', hex_key=trainKey, timeoutSecs=timeoutSecs)

            pA = h2o_cmd.ParseObj(parseResult)
            iA = h2o_cmd.InspectObj(pA.parse_key)
            parse_key = pA.parse_key
            numRows = iA.numRows
            numCols = iA.numCols
            labelList = iA.labelList

            labelListUsed = list(labelList)
            numColsUsed = numCols

            parameters = {
                'validation_frame': trainKey,
                'ignored_columns': '[CRSDepTime,CRSArrTime,ActualElapsedTime,CRSElapsedTime,AirTime,ArrDelay,DepDelay,TaxiIn,TaxiOut,Cancelled,CancellationCode,Diverted,CarrierDelay,WeatherDelay,NASDelay,SecurityDelay,LateAircraftDelay,IsArrDelayed]',
                'score_each_iteration': True,
                'response_column': response,
                'do_classification': True,
                # 'balance_classes':
                # 'max_after_balance_size':
                'ntrees': 2,
                'max_depth': 10,
                'min_rows': 3,
                'nbins': 40,
                'learn_rate': 0.2,
                # FIX! doesn't like it?
                # 'loss': 'Bernoulli',
                # FIX..no variable importance for GBM yet?
                'variable_importance': False,
                # 'seed': 
            }

            bmResult = h2o.n0.build_model(
{'fraction_non_alphanumeric': 0.12037440139312146, 'fraction_numerical': 0.014148889856334348, 'mean_word_length': 2.1131436314363143, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 1, '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': '5206437', 'n_tokens_mistral': 1499, 'n_tokens_neox': 1389, 'n_words': 236}