Skip to content

Instantly share code, notes, and snippets.

View jaimezorno's full-sized avatar

Jaime Zornoza jaimezorno

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimezorno
jaimezorno / Roulette Simulation.ipynb
Created March 24, 2020 17:15
Roulette Simulation
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimezorno
jaimezorno / Coin_Toss_Simulation.ipynb
Created March 23, 2020 18:48
Coin toss simulation for Medium article
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jaimezorno
jaimezorno / Plot_Lift_Curve.py
Created December 31, 2019 18:59
Function that plots the Lift Curve of a Machine Learning Model
# Function that plots a Lift Curve using the real label values of a dataset and the probability predictions of a Machine Learning Algorithm/model
# @Params:
# y_val: real labels of the data
# y_pred: probability predictions for such data
# step: how big we want the steps in the percentiles to be
def plot_Lift_curve(y_val, y_pred, step=0.01):
#Define an auxiliar dataframe to plot the curve
aux_lift = pd.DataFrame()
@jaimezorno
jaimezorno / Getting_Twitter_data_improved.py
Last active March 29, 2020 15:30
Improvement to the initial script about downloading data from Twitter
#Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
import re
# Enter Twitter API Keys
access_token = "ENTER ACCESS TOKEN"
access_token_secret = "ENTER ACCESS TOKEN SECRET"
consumer_key = "ENTER CONSUMER KEY"
@jaimezorno
jaimezorno / Getting_Twitter_data_ini.py
Last active August 3, 2019 13:10
Initial Twitter Downloader
#Import the necessary methods from tweepy library
from tweepy.streaming import StreamListener
from tweepy import OAuthHandler
from tweepy import Stream
# Enter Twitter API Keys
access_token = "ENTER ACCESS TOKEN"
access_token_secret = "ENTER ACCESS TOKEN SECRET"
consumer_key = "ENTER CONSUMER KEY"
consumer_secret = "ENTER CONSUMER SECRET"