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
Namespace(file=None, n_jobs=4, n_neighbors=5, sampling_strategy='auto', trials=3) | |
1 ecoli | |
0.6515465679999999 | |
2 optical_digits | |
1.081901593 | |
3 satimage | |
0.757048266 | |
4 pen_digits | |
0.7772778269999998 | |
5 abalone |
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 argparse | |
import functools | |
import numpy as np | |
import pandas as pd | |
from imblearn.datasets import fetch_datasets | |
import imblearn.datasets._zenodo as zenodo | |
from imblearn.metrics import specificity_score | |
from imblearn.over_sampling import SMOTE |
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
from time import time | |
import numpy as np | |
from scipy import sparse | |
from imblearn.over_sampling import SMOTE | |
def benchmark(sampler, X, y): | |
imb = np.unique(y, return_counts=True) |
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
from collections import namedtuple | |
from bs4 import BeautifulSoup | |
import requests | |
Time = namedtuple('Time', 'hr min sec') | |
def playlist_duration(url, speed=1): | |
source = requests.get(url) |
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 collections | |
import itertools | |
import json | |
import os | |
import random | |
SEPARATOR = '=' * 25 + '\n' | |
DEFAULT = collections.defaultdict(str) |
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 os | |
import re | |
import PyPDF2 | |
def split_eurika_book(pdf_path, page_list, *, name_format='G{grade} - M{module} L{lesson}.pdf'): | |
"""Splits a PDF of a Eurika Math book into separate sections based on | |
a list of page numbers provided. | |
""" | |
pattern = re.compile(r'[gG](\d+).[mM](\d+)') |