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
" Sebastian Raschka | |
" 09/11/2013 | |
" | |
syntax on | |
set nonumber | |
set ruler | |
set tabstop=4 | |
set shiftwidth=4 " controls the depth of autoindentation |
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 nltk | |
def eng_ratio(text): | |
''' Returns the ratio of non-English to English words from a text ''' | |
english_vocab = set(w.lower() for w in nltk.corpus.words.words()) | |
text_vocab = set(w.lower() for w in text.split() if w.lower().isalpha()) | |
unusual = text_vocab.difference(english_vocab) | |
diff = len(unusual)/len(text_vocab) | |
return diff |
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 matplotlib.colors import ListedColormap | |
import matplotlib.pyplot as plt | |
import numpy as np | |
from sklearn import datasets | |
from sklearn.linear_model import LogisticRegression | |
def plot_decision_regions(X, y, classifier, resolution=0.1): | |
# setup marker generator and color map | |
markers = ('s', 'x', 'o', '^', 'v') |
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 python | |
""" | |
simple example script for running and testing notebooks. | |
Usage: `ipnbdoctest.py foo.ipynb [bar.ipynb [...]]` | |
Each cell is submitted to the kernel, and the outputs are compared with those stored in the notebook. | |
""" | |
# License: Public Domain, but credit is nice (Min RK). |
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 time | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
from torchvision import datasets | |
from torchvision import transforms | |
from torch.utils.data import DataLoader | |
if torch.cuda.is_available(): |
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
name: base | |
channels: | |
- conda-forge | |
dependencies: | |
- absl-py=1.0.0=pyhd8ed1ab_0 | |
- aiohttp=3.8.1=py39h5161555_0 | |
- aiosignal=1.2.0=pyhd8ed1ab_0 | |
- anyio=3.5.0=py39h2804cbe_0 | |
- appnope=0.1.2=py39h2804cbe_2 | |
- argh=0.26.2=pyh9f0ad1d_1002 |
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
### EYECANDY ### | |
autoload -U colors && colors | |
PS1="%{$fg[red]%}%n%{$reset_color%}@%{$fg[blue]%}%m %{$fg[yellow]%}%~ %{$reset_color%}%% " | |
export CLICOLOR=1 | |
#export LSCOLORS=ExFxBxDxCxegedabagacad | |
#alias ls='ls -GFh' | |
### END |
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 | |
from sklearn.datasets import make_classification | |
from sklearn.model_selection import cross_val_score | |
from sklearn.tree import DecisionTreeClassifier | |
from sklearn.calibration import CalibratedClassifierCV | |
X, y = make_classification( | |
n_samples=1000, n_features=5, n_redundant=2, | |
n_clusters_per_class=1, random_state=123) |
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
categorical | measurement1 | measurement2 | label | measurement3 | |
---|---|---|---|---|---|
F | 1.428571429 | 2.721312902 | 0 | 2.089 | |
R | 0.685939167 | 0.982976329 | 0 | 0.637 | |
P | 1.055817143 | 0.624210021 | 0 | 0.226 | |
S | 0.995956364 | 0.321101265 | 0 | 0.138 | |
R | 1.376773333 | 1.578308527 | 0 | 0.478 | |
R | 0.837229167 | 1.549647481 | 0 | 0.169 | |
Q | 1.552222941 | 2.641907404 | 0 | 1.599 | |
E | 1.492519333 | 2.634558656 | 0 | 1.052 | |
W | 0.816596667 | 1.168353374 | 0 | 0.432 |
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
# Sebastian Raschka 09/24/2022 | |
# Create a new conda environment and packages | |
# conda create -n whisper python=3.9 | |
# conda activate whisper | |
# conda install mlxtend -c conda-forge | |
# Install ffmpeg | |
# macOS & homebrew | |
# brew install ffmpeg | |
# Ubuntu |
OlderNewer