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
# -*- coding: utf-8 -*- | |
""" | |
Denoise using wavelet transformations. | |
@author: Riccardo Finotello <riccardo.finotello@gmail.com> | |
""" | |
from typing import Optional | |
import numpy as np | |
import pywt |
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 matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import seaborn as sns | |
import statsmodels.formula.api as sm | |
sns.set_theme() | |
####################### | |
# # |
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
# Marchenko-Pastur distribution | |
# see https://en.wikipedia.org/wiki/Marchenko%E2%80%93Pastur_distribution | |
def marchenko_pastur(x, c, var=1.0): | |
''' | |
Marchenko-Pastur PDF. | |
Arguments: | |
x: independent variable, | |
c: phase transition parameter, |
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 sklearn.ensemble import GradientBoostingRegressor | |
from joblib import Parallel, delayed | |
# create a list of parameters | |
params = [{'learning_rate': 0.01, 'subsample': 0.8, 'n_estimators': 100}, | |
{'learning_rate': 0.03, 'subsample': 0.5, 'n_estimators': 300}, | |
{'learning_rate': 0.001, 'subsample': 0.9, 'n_estimators': 50}, | |
{'learning_rate': 0.003, 'subsample': 0.1, 'n_estimators': 10}, | |
] |