Skip to content

Instantly share code, notes, and snippets.

Benjamin Bengfort bbengfort

Block or report user

Report or block bbengfort

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
from sklearn.pipeline import Pipeline
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.decomposition import LatentDirichletAllocation
from yellowbrick.datasets import load_hobbies
class LDAViz(object):
bbengfort /
Created Aug 29, 2019
Make the Yellowbrick gource video
gource -1280x720 --camera-mode track --seconds-per-day 4 --auto-skip-seconds 1 \
--file-idle-time 0 --key --title "Yellowbrick" -o - | ffmpeg -y -r 60 \
-f image2pipe -vcodec ppm -i - -vcodec libx264 -preset ultrafast \
-pix_fmt yuv420p -crf 1 -threads 0 -bf 0 gource.mp4
#!/usr/bin/env python3
import os
import glob
import argparse
import numpy as np
import pandas as pd
import seaborn as sns
import matplotlib.pyplot as plt
View bitmask.go
type Bitmask uint8
const (
F0 bitmask = 1 << iota
func Set(b, flag Bitmask) Bitmask { return b | flag }
func Clear(b, flag Bitmask) Bitmask { return b &^ flag }
bbengfort /
Created Jul 17, 2019
Example projection visualizer with Yellowbrick
from yellowbrick.features.projection import ProjectionVisualizer
from sklearn.pipeline import Pipeline
from sklearn.decomposition import PCA
from sklearn.preprocessing import StandardScaler
from sklearn.datasets import make_regression
class Visualizer(ProjectionVisualizer):
bbengfort / stream_count.go
Created Jul 10, 2019
Quick example of getting a stream in the btrdb-go bindings and counting the number of points
View stream_count.go
package main
import (
bbengfort /
Last active Sep 25, 2019
An example of a quick method and a visualizer with detailed doc strings that discuss how best to create meaningful interactions between the two.
from sklearn.model_selection import train_test_split as tts
def visualizer(
bbengfort /
Last active Jun 4, 2019
BTrDB Helpers for common operations
import os
import time
import btrdb
from tabulate import tabulate
db = btrdb.connect("", "48BE21A7A13661B1EED5AB87")
def list_collection(prefix):
bbengfort / meta.yaml
Created May 21, 2019
Yellowbrick example conda build meta.yaml file.
View meta.yaml
{% set name = "yellowbrick" %}
{% set version = "0.9.1" %}
{% set file_ext = "tar.gz" %}
{% set hash_type = "sha256" %}
{% set hash_value = "aa85f1f3898e972e39cf8934cca37a35b7b8d376f16606681a20c95b59e9c71c" %}
name: '{{ name|lower }}'
version: '{{ version }}'
bbengfort /
Created May 18, 2019
Argparse example of color conversion in SE 2019-05-18
#!/usr/bin/env python
def hex2rgb(color):
color = color.lstrip("#")
return tuple(
int(color[idx:idx+2], 16)
for idx in (0, 2, 4)
You can’t perform that action at this time.