Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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 catboost as cb | |
cat_features_index = [0,1,2,3,4,5,6] | |
def auc(m, train, test): | |
return (metrics.roc_auc_score(y_train,m.predict_proba(train)[:,1]), | |
metrics.roc_auc_score(y_test,m.predict_proba(test)[:,1])) | |
params = {'depth': [4, 7, 10], | |
'learning_rate' : [0.03, 0.1, 0.15], | |
'l2_leaf_reg': [1,4,9], |
This file contains 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 lightgbm as lgb | |
from sklearn import metrics | |
def auc2(m, train, test): | |
return (metrics.roc_auc_score(y_train,m.predict(train)), | |
metrics.roc_auc_score(y_test,m.predict(test))) | |
lg = lgb.LGBMClassifier(silent=False) | |
param_dist = {"max_depth": [25,50, 75], | |
"learning_rate" : [0.01,0.05,0.1], |
This file contains 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
class MyStreamListener(tweepy.StreamListener): | |
def __init__(self, api=None): | |
super(MyStreamListener, self).__init__() | |
self.num_tweets = 0 | |
self.file = open("tweets.txt", "w") | |
def on_status(self, status): | |
tweet = status._json | |
self.file.write( json.dumps(tweet) + '\n' ) | |
self.num_tweets += 1 |