Skip to content

Instantly share code, notes, and snippets.

@talperetz
talperetz / Supertools Privacy Policy.html
Last active November 24, 2020 02:17
Supertools Privacy Policy
<style>
[data-custom-class='body'],
[data-custom-class='body'] * {
background: transparent !important;
}
[data-custom-class='title'],
[data-custom-class='title'] * {
font-family: Arial !important;
font-size: 26px !important;
@talperetz
talperetz / catboost_hyperopt_params.py
Created September 25, 2018 13:30
Catboost parameter space for hyperopt
import hyperopt
params_space = {
'learning_rate': hyperopt.hp.uniform('learning_rate', 0.01, 0.8),
'max_depth': scope.int(hyperopt.hp.quniform('max_depth', 2, 10, 1)),
'colsample_bylevel': hyperopt.hp.uniform('colsample_bylevel', 0.5, 1.0),
'bagging_temperature': hyperopt.hp.uniform('bagging_temperature', 0.0, 100),
'random_strength': hyperopt.hp.uniform('random_strength', 0.0, 100),
'scale_pos_weight': hyperopt.hp.uniform('scale_pos_weight', 1.0, 16.0), # change 16.0 to n_negative / n_poistive
}
@talperetz
talperetz / catboost_skopt_params.py
Last active November 1, 2018 00:33
Catboost parameter space for skopt
from skopt.space import Real, Integer
params_space = [Real(0.01, 0.8, name='learning_rate'),
Integer(2, 10, name='max_depth'),
Real(0.5, 1.0, name='colsample_bylevel'),
Real(1.0, 16.0, name='scale_pos_weight'), # change 16.0 to n_negative / n_poistive
Real(0.0, 100, name='bagging_temperature'),
Real(0.0, 100, name='random_strength'),
Real(0.0, 100, name='reg_lambda')]
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@talperetz
talperetz / gs2mongo.sh
Last active November 2, 2017 11:35
this is a solution to export big query multiple csv files into one mongo collection
# Requirements: script should be ran on relevant mongo instance
# Input: <google storage path> <db_name> <collection_name>
# TL;DR: loads multiple csv files in to mongo collection
# Author: Tal Peretz
# init vars
gs_path=$1
db_name=$2
collection_name=$3
temp_csv_name=partial_csv