This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Imports | |
| import numpy as np | |
| import pandas as pd | |
| import xgboost as xgb | |
| from interruptingcow import timeout | |
| from sklearn.model_selection import KFold # import KFold | |
| from sklearn.metrics import r2_score | |
| import json | |
| from preprocessing import preprocessing, xgb_r2_score | |
| from generate_random_configuration import generate_random_configuration |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from interruptingcow import timeout | |
| from sklearn.model_selection import KFold | |
| import pymongo | |
| from joblibspark import register_spark | |
| from joblib import Parallel, delayed | |
| from pprint import pprint | |
| import random | |
| def random_search_spark(timeout_seconds, cv_splits, boosting_rounds): | |
| # Read and preprocess input data |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import numpy as np | |
| import xgboost as xgb | |
| from sklearn.metrics import r2_score | |
| import pymongo | |
| from joblib import Parallel, delayed | |
| import random | |
| # "evaluate" is the function that is executed on the single Spark executor | |
| def evaluate(X, y, kf, boosting_rounds): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Imports | |
| import random | |
| import math | |
| def generate_random_configuration(): | |
| params = {'learning_rate': random.uniform(0.01, 0.25), | |
| 'colsample_bytree': random.uniform(0.8, 1.0), | |
| 'subsample': random.uniform(0.5, 1.0), | |
| 'n_estimators': math.floor(random.uniform(100, 3000)), | |
| 'reg_alpha': random.uniform(0.01, 0.5), |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| document.write("hello_world") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| order_id | product_id | seller_id | date | num_pieces_sold | bill_raw_text | |
|---|---|---|---|---|---|---|
| 1 | 0 | 0 | 2020-07-07 | 12 | bdgwqyboczbitqzsxwmtjhehnxyvdfsddlftaiPmDbzqntavetfrxxdyparkxinoqVcgqycdkaeowfwmingazormirqlwgcvztqdrdtnhjmkhgpxifzzadlecpycygfpdmedzecbddjujesrypwgrrlcbnorfjpyknmaccpmnagcaijgkegnpikisizjmjooicizlqneuqscjvktzbsvwpvjfdthmvmgqasstsxkcvfwdutoedebkpxagljrcspxblsfucsktxplyphxbytpozaomcbovjzymqwjzhmcrfqlnpqtlcxcjlqgivhsipmudmpgnmzozmzdfbyvnuszezasszdofwzbnyfcvqtlhohofagfdsgpcbgjsaspbnkghlqmmoekikkzfzasuzfevqpyyvzqluukxsqufviyejrgjneyocosghxqkefrplpomldzgcyrbmbckaqowwzxoeasfjndgszeeijciUficjumhajvpvau | |
| 2 | 0 | 0 | 2020-07-01 | 71 | wmewueqbyoqivcpjfsmadtgxsvxjaretdoitcymxqnfWfbycedbbvhexudyhjapqyidfuxwvnilaifpylpfxlsryrtexnfckgkmcdmmkxjrcgpultohyuqbwkrqrlkoezzehlaiahlhontcsvibbtbvclevfhiqkinklxfprejfdldzgcofhqwgyyuvxsdggpadsemwiqtcujsjcrukrildfelwagyvoduzevilIzuimflinuecfattldmgggxjyujhwhjnlqucrebqpdnoczlnouftexamxicbbfdchtZmycpjpgylmzxqcehpqspgftjfcwhzxiblqeqbcnvrjvlwsiwpwutppzgclhizcmexwhsynxacayaaulbGkoosviaxrpjpgaiisbcmkzfxnvxhoqodjmozxbp |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| product_id | product_name | price | |
|---|---|---|---|
| 0 | product_0 | 22 | |
| 1 | product_1 | 85 | |
| 2 | product_2 | 109 | |
| 3 | product_3 | 100 | |
| 4 | product_4 | 49 | |
| 5 | product_5 | 102 | |
| 6 | product_6 | 101 | |
| 7 | product_7 | 147 | |
| 8 | product_8 | 85 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| seller_id | seller_name | daily_target | |
|---|---|---|---|
| 0 | seller_0 | 2500000 | |
| 1 | seller_1 | 1187414 | |
| 2 | seller_2 | 938318 | |
| 3 | seller_3 | 1322049 | |
| 4 | seller_4 | 1543722 | |
| 5 | seller_5 | 1476659 | |
| 6 | seller_6 | 51443 | |
| 7 | seller_7 | 492968 | |
| 8 | seller_8 | 437790 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| seller_id | seller_name | daily_target | |
|---|---|---|---|
| 0 | seller_0 | 2500000 | |
| 1 | seller_1 | 1187414 | |
| 2 | seller_2 | 938318 | |
| 3 | seller_3 | 1322049 | |
| 4 | seller_4 | 1543722 | |
| 5 | seller_5 | 1476659 | |
| 6 | seller_6 | 51443 | |
| 7 | seller_7 | 492968 | |
| 8 | seller_8 | 437790 |