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
type Bitmask uint8 | |
const ( | |
F0 bitmask = 1 << iota | |
F1 | |
F2 | |
) | |
func Set(b, flag Bitmask) Bitmask { return b | flag } | |
func Clear(b, flag Bitmask) Bitmask { return b &^ flag } |
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 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): |
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
package main | |
import ( | |
"context" | |
"fmt" | |
"log" | |
"time" | |
"github.com/BTrDB/btrdb" | |
"github.com/PingThingsIO/smartgridstore/modules/creds" |
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 sklearn.model_selection import train_test_split as tts | |
def visualizer( | |
model, | |
X_train, | |
y_train, | |
X_test=None, | |
y_test=None, | |
ax=None, |
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 os | |
import time | |
import btrdb | |
from tabulate import tabulate | |
db = btrdb.connect("api.research.predictivegrid.com:4411", "48BE21A7A13661B1EED5AB87") | |
def list_collection(prefix): |
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
{% set name = "yellowbrick" %} | |
{% set version = "1.3" %} | |
{% set file_ext = "tar.gz" %} | |
{% set hash_type = "sha256" %} | |
{% set hash_value = "29eeedef78c2e5f37d05f558817b108108c34d72d37d0b05afdf969645b60ba1" %} | |
package: | |
name: '{{ name|lower }}' | |
version: '{{ version }}' |
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 | |
def hex2rgb(color): | |
color = color.lstrip("#") | |
return tuple( | |
int(color[idx:idx+2], 16) | |
for idx in (0, 2, 4) | |
) | |
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 | |
""" | |
Visual reports for classification models using matplotlib and scikit-learn. | |
""" | |
import numpy as np | |
import matplotlib.pyplot as plt | |
from sklearn.model_selection import train_test_split as tts |
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 | |
def plot_classification_report(cr, title='Classification report ', with_avg_total=False, cmap=plt.cm.Blues): | |
lines = cr.split('\n') | |
classes = [] | |
plotMat = [] | |
for line in lines[2 : (len(lines) - 3)]: |
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 | |
# codehead | |
# Scans the local directory if it's a git repository and adds the ID line. | |
# | |
# Author: Benjamin Bengfort <benjamin@bengfort.com> | |
# Created: Mon Mar 07 17:53:36 2016 -0500 | |
# | |
# Copyright (C) 2016 Bengfort.com | |
# For license information, see LICENSE.txt | |
# |