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 Counter | |
from time import perf_counter | |
import numpy as np | |
from sklearn.base import ClassifierMixin, clone | |
from sklearn.ensemble import RandomForestClassifier | |
from sklearn.model_selection import StratifiedKFold, cross_val_predict | |
from sklearn.utils import safe_indexing | |
from imblearn.under_sampling import InstanceHardnessThreshold |
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 io import StringIO | |
import tokenize, sys, os | |
import argparse | |
pref_skips = ('__', '.') # Skip folders that starts with ... | |
# From https://stackoverflow.com/a/2962727/4553309 | |
def remove_comnts(source): | |
io_obj = StringIO(source) |
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 Balance: | |
def __init__(self): | |
self.bal = 0 | |
def add(self, x): | |
self.bal += x | |
return self | |
def deduct(self, x): | |
self.bal -= x |