Goals: Add links that are reasonable and good explanations of how stuff works. No hype and no vendor content if possible. Practical first-hand accounts of models in prod eagerly sought.
![Screenshot 2023-12-18 at 10 40 27 PM](https://private-user-images.githubusercontent.com/3837836/291468646-4c30ad72-76ee-4939-a5fb-16b570d38cf2.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjExNzEwMTQsIm5iZiI6MTcyMTE3MDcxNCwicGF0aCI6Ii8zODM3ODM2LzI5MTQ2ODY0Ni00YzMwYWQ3Mi03NmVlLTQ5MzktYTVmYi0xNmI1NzBkMzhjZjIucG5nP1gtQW16LUFsZ29yaXRobT1BV1M0LUhNQUMtU0hBMjU2JlgtQW16LUNyZWRlbnRpYWw9QUtJQVZDT0RZTFNBNTNQUUs0WkElMkYyMDI0MDcxNiUyRnVzLWVhc3QtMSUyRnMzJTJGYXdzNF9yZXF1ZXN0JlgtQW16LURhdGU9MjAyNDA3MTZUMjI1ODM0WiZYLUFtei1FeHBpcmVzPTMwMCZYLUFtei1TaWduYXR1cmU9NDQzMDMzOWViOWRmMmI4ZGQ0MjAxMzAxMDg5ZWQ5ODg1YzhiNWEwMjYyM2RlOWY0ZDc4NzFiYWQ2NGJhMWRiOSZYLUFtei1TaWduZWRIZWFkZXJzPWhvc3QmYWN0b3JfaWQ9MCZrZXlfaWQ9MCZyZXBvX2lkPTAifQ.nuCLlhYp68SCBbT52DDZhu20lvs6-OouZYUZ7cjESJQ)
import numpy as np | |
from sklearn.utils.class_weight import compute_class_weight | |
from sklearn.preprocessing import MultiLabelBinarizer | |
def generate_class_weights(class_series, multi_class=True, one_hot_encoded=False): | |
""" | |
Method to generate class weights given a set of multi-class or multi-label labels, both one-hot-encoded or not. | |
Some examples of different formats of class_series and their outputs are: |
FROM alpine:3.13 | |
WORKDIR /opt/draft-proxy | |
RUN apk update && apk add git curl | |
RUN curl -L -o package.tgz https://github.com/oauth2-proxy/oauth2-proxy/releases/download/v6.1.1/oauth2-proxy-v6.1.1.linux-amd64.tar.gz && \ | |
tar xvzf package.tgz && \ | |
mv oauth2-proxy-*.linux-amd64/oauth2-proxy . | |
CMD ["./oauth2-proxy", \ | |
"--provider=github", "--github-org=YOUR_GITHUB_ORG", "--email-domain=*", \ | |
"--http-address=0.0.0.0:8080", \ | |
"--reverse-proxy=true", \ |
""" | |
Optuna example that optimizes a simple quadratic function in parallel using `joblib` allowing | |
arbitrary arguments to the objective function. | |
Run the example as follows. | |
$ python quadratic_joblib_simple.py | |
If you need to rerun the example and thus delete previous studies, you can use the Optuna CLI. |
The documentation for how to deploy a pipeline with extra, non-PyPi, pure Python packages on GCP is missing some detail. This gist shows how to package and deploy an external pure-Python, non-PyPi dependency to a managed dataflow pipeline on GCP.
TL;DR: You external package needs to be a python (source/binary) distro properly packaged and shipped alongside your pipeline. It is not enough to only specify a tar file with a setup.py
.
Your external package must have a proper setup.py
. What follow is an example setup.py
for our ETL
package. This is used to package version 1.1.1 of the etl library. The library requires 3 native PyPi packages to run. These are specified in the install_requires
field. This package also ships with custom external JSON data, declared in the package_data
section. Last, the setuptools.find_packages
function searches for all available packages and returns that
As configured in my dotfiles.
start new:
tmux
start new with session name:
Simplest intro to git by github and codeschool - Try Git
[Intro to github]
The goal of this example is to show how an existing C codebase for numerical computing (here c_code.c) can be wrapped in Cython to be exposed in Python.
The meat of the example is that the data is allocated in C, but exposed in Python without a copy using the PyArray_SimpleNewFromData numpy