Skip to content

Instantly share code, notes, and snippets.

View nerdinand's full-sized avatar
💭
wat

Ferdinand Niedermann nerdinand

💭
wat
View GitHub Profile
import turicreate as tc
import pandas as pd
def print_human_confusion_matrix(actual, predicted):
cf_matrix = tc.evaluation.confusion_matrix(actual, predicted)
labels = list(set(cf_matrix['predicted_label'].append(cf_matrix['target_label'])))
matrix = []
@nerdinand
nerdinand / Dockerfile
Created January 29, 2022 22:32
Podman setup for Rails 7 (without compose or database)
FROM ruby:3.1
# throw errors if Gemfile has been modified since Gemfile.lock
RUN bundle config --global frozen 1
WORKDIR /usr/src/app
COPY Gemfile Gemfile.lock ./
RUN bundle install
@nerdinand
nerdinand / read-env.py
Created March 16, 2023 14:19
Quick and dirty env.sh file reading and applying in Python (useful for example in a Jupyter Notebook)
import re
import os
for m in re.finditer(r'export (.*)=([^ \n]+)', open('../env.sh').read()):
os.environ[m[1]] = m[2]