I hereby claim:
- I am chkoar on github.
- I am chkoar (https://keybase.io/chkoar) on keybase.
- I have a public key ASAbSg2GwCBc-h7NJdDMAFb7ak2LQoMFgacgQZQFSZQfDgo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
import numpy as np | |
from imblearn.over_sampling import SMOTE | |
def generate_data(X, ratio=1.0, resampler=None, random_state=None): | |
y = [1] * X.shape[0] | |
n_samples = X.shape[0] | |
n_features = X.shape[1] |
def uuid(seed=None): | |
""" | |
Shortcut function to generate reproducible version 4 | |
Universally Unique IDentifiers (UUIDs). | |
""" | |
import uuid | |
import random | |
rd = random.Random() |
import pandas as pd | |
def describex(data): | |
data = pd.DataFrame(data) | |
stats = data.describe() | |
skewness = data.skew() | |
kurtosis = data.kurtosis() | |
skewness_df = pd.DataFrame({'skewness':skewness}).T | |
kurtosis_df = pd.DataFrame({'kurtosis':kurtosis}).T | |
return stats.append([kurtosis_df,skewness_df]) |
import uuid | |
from pathlib import Path | |
from sklearn.base import BaseEstimator, ClassifierMixin, clone | |
from sklearn.datasets import make_classification | |
from sklearn.externals import joblib | |
from sklearn.feature_selection import SelectPercentile | |
from sklearn.model_selection import cross_val_score | |
from sklearn.pipeline import make_pipeline | |
from sklearn.svm import LinearSVC |
def test_stationarity(timeseries): | |
import matplotlib.pyplot as plt | |
from statsmodels.tsa.stattools import adfuller | |
#Determing rolling statistics | |
rolmean = pd.rolling_mean(timeseries, window=12) | |
rolstd = pd.rolling_std(timeseries, window=12) | |
#Plot rolling statistics: | |
orig = plt.plot(timeseries, color='blue',label='Original') |
import sys | |
from imblearn.combine import * | |
from imblearn.over_sampling import * | |
from imblearn.under_sampling import * | |
def make_sampler(cls, **kwargs): | |
_ = sys.modules[__name__] | |
return getattr(_, cls)().set_params(**kwargs) | |
# example |