Skip to content

Instantly share code, notes, and snippets.

View leferrad's full-sized avatar

Leandro Ferrado leferrad

View GitHub Profile
@leferrad
leferrad / ytdownloader.py
Last active June 17, 2024 01:55
Script to download MP3 files from YouTube links
"""Script to download Audio files from YouTube links.
Pip dependencies:
- pytube
"""
import os
import time
from pytube import Playlist, YouTube
@leferrad
leferrad / metrics_supervised.py
Last active March 22, 2020 18:08
Standard metrics for both classification and regression problems in supervised learning
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Metrics for measuring the performance of a model in a given dataset,
in both kinds of problems: *classification* and *regression*.
Implementation extracted from: https://github.com/leferrad/learninspy/blob/master/learninspy/utils/evaluation.py
NOTE: Only working with Python 2.7.x
@leferrad
leferrad / rbf_timestamp_features.py
Last active July 9, 2021 14:18
Feature extraction of timestamp based on RBF + polar coordinates of a clock
#!/usr/bin/env python
# -*- coding: utf-8 -*-
""""""
import matplotlib
matplotlib.use("TkAgg")
from datetime import datetime as dt
import numpy as np
@leferrad
leferrad / 9gag_data_extraction_main.py
Created September 22, 2017 05:27
Extract images from 9GAG through a simple interactive main in Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Script to get images from 9gag, based on https://github.com/sashgorokhov/python-ninegag"""
# Python 2 and 3 compatibility
from __future__ import print_function
from builtins import input
from bs4 import BeautifulSoup