<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 Benchmarking MLDB
This notebook contains the code to run "The Absolute Minimum Benchmark" for a machine learning tool.
First we load the Python MLDB helper library
Step1:  Next we create the datasets directly from the remote files.
Step4:  Now we create the experimental setup.
Step5:  Finally, we run the experiment inside a timing block. On an otherwise-unloaded AWS EC2 r3.8xlarge instance (32 cores, 240GB of RAM) it takes around 20 seconds to reach an AUC of more than 0.74.
<ASSISTANT_TASK:>
Python Code:
from pymldb import Connection
mldb = Connection("http://localhost/")
Explanation: Benchmarking MLDB
This notebook contains the code to run "The Absolute Minimum Benchmark" for a machine learning tool.
First we load the Python MLDB helper library
End of explanation
mldb.put('/v1/procedures/import_bench_train_1m', {
    "type": "import.text",
    "params": { 
        "dataFileUrl": "https://s3.amazonaws.com/benchm-ml--main/train-1m.csv",
        "outputDataset":"bench_train_1m",
        "runOnCreation": True
    }
})
mldb.put('/v1/procedures/import_bench_test', {
    "type": "import.text",
    "params": { 
        "dataFileUrl": "https://s3.amazonaws.com/benchm-ml--main/test.csv",
        "outputDataset":"bench_test",
        "runOnCreation": True
    }
})
print "Datasets loaded."
Explanation: Next we create the datasets directly from the remote files.
End of explanation
mldb.put('/v1/procedures/benchmark', {
    "type": "classifier.experiment",
    "params": {
        "experimentName": "benchm_ml",
        "inputData": 
            select
                {* EXCLUDING(dep_delayed_15min)} as features,
                dep_delayed_15min = 'Y' as label
            from bench_train_1m
            ,
        "testingDataOverride":  
            select
                {* EXCLUDING(dep_delayed_15min)} as features,
                dep_delayed_15min = 'Y' as label
            from bench_test
            ,
        "configuration": {
            "type": "bagging",
            "num_bags": 100,
            "validation_split": 0,
            "weak_learner": {
                "type": "decision_tree",
                "max_depth": 20,
                "random_feature_propn": 0.3
            }
        },
        "modelFileUrlPattern": "file:///mldb_data/models/benchml_$runid.cls",       
        "mode": "boolean"
    }
})
print "Ready to go!"
Explanation: Now we create the experimental setup.
End of explanation
import time
start_time = time.time()
result = mldb.post('/v1/procedures/benchmark/runs')
run_time = time.time() - start_time
auc = result.json()["status"]["folds"][0]["resultsTest"]["auc"]
print "\n\nAUC = %0.10f, time = %0.4f\n\n" % (auc, run_time)
Explanation: Finally, we run the experiment inside a timing block. On an otherwise-unloaded AWS EC2 r3.8xlarge instance (32 cores, 240GB of RAM) it takes around 20 seconds to reach an AUC of more than 0.74.
End of explanation
<END_TASK>