Skip to content

Instantly share code, notes, and snippets.

View Planeshifter's full-sized avatar
🎯
Focusing

Philipp Burckhardt Planeshifter

🎯
Focusing
View GitHub Profile
@Planeshifter
Planeshifter / SCORE_Marathon.csv
Last active September 21, 2022 20:31
Data Set
Days_Between_Record
1 161
2 42
3 85
4 2
5 113
6 1350
7 19
8 547
9 2093
@Planeshifter
Planeshifter / HELPrct.isle
Created January 20, 2021 01:38
Exporting dataset from R
---
title: HELPrct
language: en-US
state: null
license: 'CC BY 4.0 [https://creativecommons.org/licenses/by/4.0]'
require:
dataFile: 'https://isle.stat.cmu.edu/data-explorers_HELPrct.json'
dataInfoFile: 'https://isle.stat.cmu.edu/data-explorers_HELPrct_info.json'
---
@Planeshifter
Planeshifter / gist:51db8a4831038ffbb23d9fbeadc5543d
Last active August 19, 2020 17:41
Use HTML lists <ol> (ordered list), <ul> (unordered list), and <li> (list item)
<ol>
<li>The output below pertains to the participants in the Fast Food experiment. It reports summary statistics for the variable “dieting” by the respondent’s self-identified race. Variable “dieting” is coded as 1 if the respondent reported he/she was dieting, and 0 if the respondent reported no. From this table, calculate the probability that a randomly chosen participant in this experiment is dieting. Show the basis for your calculation and perform this calculation with relevant probabilities calculated to the thousandth (e.g, 0.342, 0.096, 0.004). (Note: You’ll observe that the top row constituing 22 respondents reports no race. Do not include this group in your calculation.)
<Image src="https://isle.heinz.cmu.edu/95-796_Module3c_Q1.jpg" alt="Homework 2 Question 1 Image" />
</li>
<li>This problem concerns testing for COVID19 antibodies.
Let:
$C^{+}$ denote actually having COVID19 antibodies (i.e. “ground truth”) <br />
$\tilde{C}^{+}$ denote not actually having COVID19 antibodies (i.e.
@Planeshifter
Planeshifter / evaluate.js
Created August 13, 2020 04:45
Evaluation Script for deidentify results
// MODULES //
const fs = require( 'fs' );
const { join } = require( 'path' );
// VARIABLES //
const RECORDS = {};
const FLAGGED = {
@Planeshifter
Planeshifter / diabetes_info.json
Created August 12, 2020 14:46
Diabetes Info Files
{
"name": "Diabetes Treatment Data",
"info": [
"Diabetes, a metabolic disease affecting insulin production can be managable given proper treatment.",
"In certain cases a diagnosis of diabetes is initially treated and controlled in a hospital setting.",
"To better study the treatment patterns and outcomes, we have assembled a sample of ten years of",
" clinical care at 130 U.S hospitals for patients who were admitted with diabetes."
],
"variables": {
"race": "Race of patient. One of \"Caucasian\", \"AfricanAmerican\", \"Hispanic\", \"Other\" or \"Asian\".",
@Planeshifter
Planeshifter / gist:43312dc3f141602a8044f8e6b26a6481
Created August 12, 2020 14:42
R Script to save data in JSON
library(jsonlite)
library(readr)
diabetes <- readr::read_csv("diabetes.csv")
write( toJSON( diabetes, dataframe = "columns" ), "diabetes.json" )
IDENTIFIED
{
DATE: { missed: 792, hits: 4166, recall: 0.8402581686163776 },
DOCTOR: { missed: 310, hits: 1575, recall: 0.8355437665782494 },
PATIENT: { missed: 186, hits: 684, recall: 0.7862068965517242 },
USERNAME: { missed: 0, hits: 92, recall: 1 },
HOSPITAL: { missed: 62, hits: 712, recall: 0.9198966408268734 },
STREET: { missed: 50, hits: 85, recall: 0.6296296296296297 },
CITY: { missed: 44, hits: 210, recall: 0.8267716535433071 },
STATE: { missed: 2, hits: 188, recall: 0.9894736842105263 },
@Planeshifter
Planeshifter / accuracy.js
Last active July 20, 2020 03:33
Accuracy Evaluation for deidentify outputs on i2b2 corpus
// MODULES //
const fastXmlParser = require( 'fast-xml-parser' );
const readDir = require( '@stdlib/fs/read-dir' );
const endsWith = require( '@stdlib/string/ends-with' );
const isUppercase = require( '@stdlib/assert/is-uppercase' );
const contains = require( '@stdlib/assert/contains' );
const fs = require( 'fs' );
const join = require( 'path' ).join;
@Planeshifter
Planeshifter / cla.txt
Last active December 2, 2019 20:05
ISLE Individual Contributor License Agreement
# ISLE Individual Contributor License Agreement
Thank you for your interest in contributing to open source software projects (“Projects”) made available by [ISLE]. This Individual Contributor License Agreement (“Agreement”) sets out the terms governing any source code, object code, bug fixes, configuration changes, tools, specifications, documentation, data, materials, feedback, information or other works of authorship that you submit or have submitted, in any form and in any manner, to [ISLE] in respect of any of the Projects (collectively “Contributions”). If you have any questions respecting this Agreement, please contact [email protected].
You agree that the following terms apply to all of your past, present and future Contributions. Except for the licenses granted in this Agreement, you retain all of your right, title and interest in and to your Contributions.
**Copyright License**. You hereby grant, and agree to grant, to [ISLE] a non-exclusive, perpetual, irrevocable, worldwide, fully-paid, royalty
var request = require('request');
var $ = require('cheerio');
var url = 'http://games.espn.com/fba/scoreboard?leagueId=21154&scoringPeriodId=161';
request(url, function(err, resp, body){
console.log( body )
});