Skip to content

Instantly share code, notes, and snippets.

View brianckeegan's full-sized avatar

Brian Keegan brianckeegan

View GitHub Profile
@leblancfg
leblancfg / tableau_10.scss
Created October 6, 2020 13:41
Tableau 10 Color Palette Hex Codes
// Tableau 10 color theme
$themes: (
blue: #5778a4,
orange: #e49444,
red: #d1615d,
teal: #85b6b2,
green: #6a9f58,
yellow: #e7ca60,
purple: #a87c9f,
pink: #f1a2a9,
@aricooperdavis
aricooperdavis / 3d_regression_example.py
Last active February 2, 2024 13:13
Example of 3D plots illustrating Linear Regression with 2 features and 1 target
import matplotlib.pyplot as plt
import numpy as np
import sklearn.linear_model
from mpl_toolkits.mplot3d import Axes3D
X_train = np.random.rand(2000).reshape(1000,2)*60
y_train = (X_train[:, 0]**2)+(X_train[:, 1]**2)
X_test = np.random.rand(200).reshape(100,2)*60
y_test = (X_test[:, 0]**2)+(X_test[:, 1]**2)
@ebressert
ebressert / colormap_editor.py
Last active September 28, 2020 14:57
Advanced color editing for Matplotlib and Seaborn
import colorsys
import numpy as np
import matplotlib.pyplot as plt
import seaborn as sns
%matplotlib inline
def alter(alist, col, factor=1.1):
tmp = np.array(alist)
tmp[:,col] = tmp[:,col] * factor
tmp[tmp > 1] = 1
@dsparks
dsparks / coefficent_plot_walkthrough.R
Created December 18, 2012 22:31
A coefficient plot for multiple models
doInstall <- TRUE
toInstall <- c("ggplot2")
if(doInstall){install.packages(toInstall, repos = "http://cran.us.r-project.org")}
lapply(toInstall, library, character.only = TRUE)
ANES <- read.csv("http://www.oberlin.edu/faculty/cdesante/assets/downloads/ANES.csv")
ANES <- ANES[ANES$year == 2008, -c(1, 11, 17)] # Limit to just 2008 respondents,
head(ANES) # remove some non-helpful variables
# Fit several models with the same DV:
@sixtenbe
sixtenbe / analytic_wfm.py
Last active May 27, 2024 01:24 — forked from endolith/peakdet.m
Peak detection in Python
#!/usr/bin/python2
# Copyright (C) 2016 Sixten Bergman
# License WTFPL
#
# This program is free software. It comes without any warranty, to the extent
# permitted by applicable law.
# You can redistribute it and/or modify it under the terms of the Do What The
# Fuck You Want To Public License, Version 2, as published by Sam Hocevar. See