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 numpy as np | |
import matplotlib.pyplot as plt | |
from scipy.signal import lfilter | |
# Step 1: Create a synthetic dataset | |
np.random.seed(42) # For reproducibility | |
N = 1000 # Number of samples | |
x = np.random.randn(N) # Input signal (random noise) | |
w_true = np.array([0.5, -0.3, 0.1]) # True filter coefficients | |
e_ = 0.01 * np.random.randn(N) # Noise |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 numpy as np | |
import vtk | |
import pyvista as pv | |
from vtk.util import numpy_support | |
# from vtk.numpy_interface import dataset_adapter as dsa | |
data = np.zeros((50, 50, 50)) | |
data[20:30, 20:30, 20:30] = 1 | |
data_vtk = numpy_support.numpy_to_vtk( |
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
#!/usr/bin/env python3 | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Sun Sep 20 19:45:49 2020 | |
@author: zhanglingxi | |
""" | |
import os | |
import os.path as op |
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 pathlib import Path | |
from nbconvert import PythonExporter | |
import textwrap | |
exporter = PythonExporter() | |
notebook = Path('docs/tutorials/decomposition/ajive_tutorial.ipynb') | |
def nb2py(notebook): |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
""" | |
Benchmark of MultiTaskLasso | |
""" | |
import gc | |
from itertools import product | |
from time import time | |
import numpy as np | |
import pandas as pd | |
from sklearn.datasets import make_regression |
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
$ pip list | |
Package Version Location | |
--------------------------------- --------------------- ------------------------------------------------------------------------- | |
absl-py 0.7.1 | |
alabaster 0.7.11 | |
alembic 1.0.11 | |
alphacsc 0.4.dev0 /Users/alex/work/src/alphacsc | |
alphawaves 0.1 /Users/alex/work/src/Alpha-Waves-Dataset | |
appdirs 1.4.3 | |
appnope 0.1.0 |
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 numpy as np | |
import pandas as pd | |
from sklearn.preprocessing import OrdinalEncoder | |
class CountOrdinalEncoder(OrdinalEncoder): | |
"""Encode categorical features as an integer array | |
usint count information. | |
""" | |
def __init__(self, categories='auto', dtype=np.float64): | |
self.categories = categories |
NewerOlder