Skip to content

Instantly share code, notes, and snippets.


Steph Locke stephlocke

View GitHub Profile
stephlocke / app.R
Last active Apr 16, 2021
Demo shiny app for multiple file uploads and a single read step
View app.R
ui <- fluidPage(
titlePanel("Multiple file uploads"),
label="Upload CSVs here",
multiple = TRUE)
View Evaluating Logistic Regression Models in R.Rmd
This post provides an overview of performing diagnostic and performance evaluation on logistic regression models in R. After training a statistical model, it’s important to understand how well that model did in regards to it’s accuracy and predictive power. The following content will provide the background and theory to ensure that the right technique are being utilized for evaluating logistic regression models in R.
Logistic Regression Example
We will use the GermanCredit dataset in the caret package for this example. It contains 62 characteristics and 1000 observations, with a target variable (Class) that is allready defined. The response variable is coded 0 for bad consumer and 1 for good. It’s always recommended that one looks at the coding of the response variable to ensure that it’s a factor variable that’s coded accurately with a 0/1 scheme or two factor levels in the right order. The first step is to partition the data into training and testing sets.
Train <- cr
View example.yaml
name: Generate Word docs
on: push
runs-on: ubuntu-20.04
- uses: actions/checkout@v2
- name: convert md to docx
uses: docker://pandoc/latex:2.9
stephlocke /
Created Sep 20, 2018
Some links and resources around ethical data science

Ethical data science


Who I am

Purpose / Agenda

Problems caused

Facial recognition

Justice system

Access to finance

Ethical obligation

stephlocke / extract.pq
Created Nov 9, 2020
Get and transform NomCom table in Power Query
View extract.pq
Source = Web.Page(Web.Contents("")),
Data5 = Source{5}[Data],
#"Changed Type" = Table.TransformColumnTypes(Data5,{{"", type text}, {"Joey D'Antoni", type number}, {"Lori Edwards", type number}, {"Roberto Fonseca", type number}, {"Matt Gordon", type number}, {"Stephanie Locke", type number}, {"Jose L. Rivera", type number}, {"Hamish Watson", type number}}),
#"Renamed Columns" = Table.RenameColumns(#"Changed Type",{{"", "Area"}}),
#"Unpivoted Other Columns" = Table.UnpivotOtherColumns(#"Renamed Columns", {"Area"}, "Attribute", "Value"),
#"Renamed Columns1" = Table.RenameColumns(#"Unpivoted Other Columns",{{"Attribute", "Candidate"}})
#"Renamed Columns1"
stephlocke / grouping.r
Created Jan 6, 2020
Quickly allocate some groups into partitions with other groups of similar size
View grouping.r
# Generate sample distributions
n = 1e2
t = 3e6
min_r = t/1000
max_r = t/50
c = 0
r = vector(mode="numeric")
for(x in 1:n){
stephlocke / generate.R
Last active Oct 19, 2019
Generate card backs for user logins
View generate.R
# inputs
setwd("c:/Users/steph/Dropbox/Locke Data/LoginCards/")
myfile <- "MiniBack.pdf"
# write.csv(data.frame(usernames=paste0("u",stringr::str_pad(1:n,pad = "0",width = 3))
# ,pwords=random::randomStrings(n,len = 6,digits = FALSE,loweralpha = FALSE))
stephlocke /
Last active Apr 1, 2019
Work with git! 🎓=💪
title author date
Working with Git
Steph Locke
15 September 2018

Source control fundamentals

Source control concepts

View file531c2cc66751.R
title: "First dash"
orientation: columns
vertical_layout: fill
runtime: shiny
```{r setup, include=FALSE}