Skip to content

Instantly share code, notes, and snippets.

View AndreasThinks's full-sized avatar

Andreas Varotsis AndreasThinks

View GitHub Profile
@AndreasThinks
AndreasThinks / main.py
Created February 13, 2025 21:06
FastHTML sqlite management
# -----------------------
# Routes: Admin
# -----------------------
@app.get("/admin")
def get_admin(req):
auth = req.scope.get("auth")
if not auth:
return RedirectResponse("/login", status_code=303)
@AndreasThinks
AndreasThinks / debate.md
Created September 18, 2024 17:15
# The Role of Randomized Controlled Trials in Criminal Justice: A Debate

The Role of Randomized Controlled Trials in Criminal Justice: A Debate

Criminal justice reform has long been a contested space for research and policy, with scholars and practitioners searching for effective ways to drive change. One of the most debated tools in this context is the randomized controlled trial (RCT). Traditionally considered the "gold standard" for evaluating interventions, RCTs have recently come under scrutiny for their effectiveness in the criminal justice field.

Two key articles address this issue: Cause, Effect, and the Structure of the Social World by Megan Stevenson, and Then a Miracle Occurs: Cause, Effect, and the Heterogeneity of Criminal Justice Research by Brandon del Pozo and colleagues. Stevenson's piece is a critique of the use of RCTs in criminal justice, while del Pozo's article serves as a counterargument, challenging the validity of Stevenson’s conclusions. This post delves into both perspectives, exploring their arguments, methodologies, and conclusions, with the a

Model AGIEval GPT4All TruthfulQA Bigbench
mistral-7b-english-welsh-translate 35.44 Error: File does not exist 54.51 Error: File does not exist

AGIEval

Task Version Metric Value Stderr
agieval_aqua_rat 0 acc 24.41 ± 2.70
acc_norm 20.87 ± 2.55
agieval_logiqa_en 0 acc 33.95 ± 1.86
Model AGIEval GPT4All TruthfulQA Bigbench
mistral-7b-english-welsh-translate 35.31 Error: File does not exist 54.5 38.4

AGIEval

Task Version Metric Value Stderr
agieval_aqua_rat 0 acc 24.02 ± 2.69
acc_norm 20.47 ± 2.54
agieval_logiqa_en 0 acc 33.95 ± 1.86
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@AndreasThinks
AndreasThinks / fuzzy_analysis.py
Last active April 30, 2020 18:18
iterate through words and identify common drug names
from fuzzywuzzy import fuzz
drug_dict = pd.read_csv("drugs.csv", encoding= "ISO-8859-1")
drug_dict = drug_dict.rename(columns={"Substances: Category & Name": "substance", "Examples of Commercial & Street Names": "names"})
#this function will return the highest value from the list and it's ratio of "sameness"
def compare_to_list(description, list_to_compare):
accuracy_dict = {}
for comparator in list_to_compare:
for word in description.split():
import pandas as pd
import statsmodels.api as sm
df = pd.read_csv('loansData_clean.csv')
overTwelve = []
intercept = []
for item in df['Interest.Rate']:
overTwelve.append(item < 12)
import pandas as pd
import matplotlib.pyplot as plt
import statsmodels.api as sm
import numpy as np
loansData = pd.read_csv('loansData.csv')
@AndreasThinks
AndreasThinks / scatter
Created December 22, 2014 16:23
scatter
import pandas as pd
import matplotlib.pyplot as plt
loansData = pd.read_csv('loansData.csv')
month = lambda x: x[:-6]
percent = lambda x: float(x[:-1])
fico = lambda x: x[:-4]
amount = lambda x: float(x)