Skip to content

Instantly share code, notes, and snippets.

View mcozar99's full-sized avatar
🎯
Focusing

Miguel Cózar mcozar99

🎯
Focusing
View GitHub Profile
y_pred y_test diff abs_diff
0.264 0.282 -0.018 0.018
0.514 0.409 0.105 0.105
0.340 0.318 0.022 0.022
0.184 0.145 0.039 0.039
0.365 0.387 -0.022 0.022
0.542 0.574 -0.033 0.033
0.319 0.360 -0.041 0.041
0.431 0.429 0.002 0.002
0.262 0.344 -0.082 0.082
from tensorflow import keras
from keras.models import Sequential
from keras import layers
from keras.optimizers import Adam
def generate_model():
"""Creates the model and compiles it"""
model = Sequential()
model.add(layers.Conv1D(4, 6, padding='valid', kernel_regularizer='l2', input_shape=(100, 1)))
@mcozar99
mcozar99 / lyrics_gatherer.py
Last active November 19, 2022 15:33
Class that gathers and encodes lyrics for any song given its title and artist, and prepares it to be introduced into a neural network
from sentence_transformers import SentenceTransformer
from deep_translator import GoogleTranslator
import langdetect
import textwrap
import random
import lyricsgenius
GENIUS_TOKEN = "XXXXXXXXXXXXXXXX"
class LyricsGatherer:
@mcozar99
mcozar99 / mobile_app_experiment.csv
Created January 12, 2022 09:44
Experiment testing commercial databases with ip addresses extracted from mobile app automatic interaction.
ip ip2location ipinfo db-ip maxmind
52.84.68.29 Spain Spain Spain United States
34.243.188.235 Ireland Ireland Ireland Ireland
52.44.62.213 United States United States United States United States
52.84.68.82 Spain Spain Spain United States
52.84.68.5 Spain Spain Spain United States
52.84.68.19 Spain Spain Spain United States
82.165.74.143 Germany Germany Germany Germany
203.171.211.174 India India India India
103.147.26.115 India India India India
@mcozar99
mcozar99 / firebaseinstallations_googleapis_com.csv
Last active January 11, 2022 16:13
Evolution of ip assignment to a domain in a particular place over a day
timestamp ip country
29/11/2021 18:23:25 142.250.185.10 Spain
29/11/2021 18:33:27 142.250.200.138 United States
29/11/2021 18:43:30 172.217.17.10 Spain
29/11/2021 18:53:32 172.217.168.170 Spain
29/11/2021 19:03:34 142.250.200.74 United States
29/11/2021 19:13:37 216.58.215.138 Spain
29/11/2021 19:23:39 142.250.184.170 Spain
29/11/2021 19:33:42 142.250.178.170 Spain
29/11/2021 19:43:44 142.250.185.10 Spain
@mcozar99
mcozar99 / top_versatile.csv
Last active October 11, 2021 10:06
Most versatile artists
Artist Versatility Score
Tiësto 12
Diplo 12
BTS 11
Bad Bunny 11
Juice WRLD 11
Ozuna 11
Drake 10
Kanye West 10
David Guetta 10
@mcozar99
mcozar99 / viral_artists.py
Last active October 11, 2021 13:55
Top Viral Artists
from bs4 import BeautifulSoup
import requests
from collections import Counter
# GET the global most listened songs since 2013 from this page
n = 300
artists = []
home_page='https://kworb.net/spotify/country/global_weekly_totals.html'
hsession = requests.Session()
hresponse = hsession.get(home_page)