You'll need ripgrep
and pandoc
to get started. You can read more about ripgrep here and pandoc here. I use both of these frequently and they're quite helpful.
You can install them both with homebrew
:
brew install pandoc ripgrep
from sklearn.base import BaseEstimator, ClassifierMixin | |
from scipy.special import expit, logit | |
class SoftLabelClassifier(BaseEstimator, ClassifierMixin): | |
def __init__(self, regressor, eps=0.001): | |
self.regressor = regressor | |
self.eps = eps | |
def fit(self, X, y=None): |
#cloud-config | |
package_upgrade: true | |
ssh_authorized_keys: | |
- <your key> | |
packages: | |
- apt-transport-https | |
- ca-certificates | |
- curl |
import numpy as np | |
import numba | |
@numba.njit() | |
def tsss(vec1, vec2): | |
euclidean_distance = np.linalg.norm(vec1 - vec2) | |
cosine_distance = np.dot(vec1, vec2.T) / ( | |
np.linalg.norm(vec1) * np.linalg.norm(vec2) | |
) |
You must be using conda for this approach. You will need conda installed on the Source machine and the Target machine. The Source machine must have an internet connection, the Target does not. The OS in both environments must match; no going from macOS to Win10 for example.
1. (Source) Install conda-pack
in your base
python environment.
conda install -c conda-forge conda-pack
# ⛔️ BAD EXAMPLE: PRE-REFACTOR | |
## app.py | |
import streamlit as st | |
import pandas as pd | |
data = pd.read_csv("data.csv") # no function → no cache, requires pandas import: 👎,👎 | |
sample = data.head(100) # not input into streamlit object: 👎 | |
described_sample = sample.describe() # input into streamlit object: ✅ | |
st.write(described_sample) |
from time import time | |
import altair as alt | |
import matplotlib.pyplot as plt | |
import numpy as np | |
import pandas as pd | |
import streamlit as st | |
def mpl_scatter(dataset, x, y): |
import altair as alt | |
import streamlit as st | |
from vega_datasets import data | |
cars = data.cars() | |
quantitative_variables = [ | |
"Miles_per_Gallon", | |
"Cylinders", | |
"Displacement", |
import streamlit as st | |
from vega_datasets import data | |
from time import time | |
import pandas as pd | |
@st.cache | |
def load_data(): | |
return pd.concat((data.airports() for _ in range(100))) |
import streamlit as st | |
from vega_datasets import data | |
@st.cache | |
def load_data(): | |
return data.birdstrikes() | |
cols = { |