Skip to content

Instantly share code, notes, and snippets.

View danielduckworth's full-sized avatar

Daniel Duckworth danielduckworth

  • IEA
  • Melbourne, Australia
View GitHub Profile
@danielduckworth
danielduckworth / README.md
Created February 23, 2024 02:26
Hierarchical Evaluation Measure

Hierarchical evaluation measure

Python implementaion of HAM as deseibed in Functional Annotation of Genes Using Hierarchical Text Categorization

Functional Annotation of Genes Using Hierarchical Text Categorization

3.3 Hierarchical evaluation measure

Most researchers evaluate hierarchical classification systems based on standard “flat” measures: accuracy/error and precision/recall. However, these measures are not suitable for hierarchical categorization since they do not differentiate among different kinds of misclassification errors. A widely-used hierarchical measure based on the notion of distance overcomes this problem. However, it has some drawbacks. First, it is not easily extendable to DAG hierarchies (where multiple paths between two categories can exist) and multi-label tasks. Second, it does not change with depth. Misclassification into a sibling category of a top

@danielduckworth
danielduckworth / games.yaml
Last active December 16, 2023 09:13
Steam games
---
response:
apps:
- appid: 228980
app: Steamworks Common Redistributables
app_type: tool
available_on_platform: true
- appid: 250820
app: SteamVR
app_type: tool
@danielduckworth
danielduckworth / vega-v5.json
Created November 9, 2023 05:05
Vega chart schema
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "Vega Visualization Specification Language",
"definitions": {
"autosize": {
"oneOf": [
{
"enum": ["pad", "fit", "fit-x", "fit-y", "none"],
"default": "pad"
},
@danielduckworth
danielduckworth / chromadb-cheatsheet.md
Last active October 23, 2024 06:09
Chromadb JS API Cheatsheet

Chromadb Javascript API Cheatsheet

💡 NOTE This is a quick cheatsheet of the API. For full API docs, refer to the JS and Python docs in the sidebar.

Run the backend

Run chroma run --path /db_path to run the Chroma backend as a standalone server on your local computer.

@danielduckworth
danielduckworth / DirectusInput.tsx
Created November 1, 2023 15:47 — forked from izoukhai/DirectusInput.tsx
Generate forms from Directus CMS and render them with NextJS
"use client";
import { FieldValues, UseFormProps, UseFormReturn } from "react-hook-form";
import { ApiCollections } from "../../../@types/api";
export const DirectusInput = (props: {
element: ApiCollections["form_components"];
hookForm: UseFormReturn<FieldValues, any>;
}) => {
const { element, hookForm } = props;
@danielduckworth
danielduckworth / ImageExample.vue
Created October 28, 2023 04:38 — forked from TheBITLINK/ImageExample.vue
Material Design 3 (Material You) Theme Generator for Vuetify
<script setup lang="ts">
import { useTheme } from 'vuetify'
import { vuetifyThemeFromImage } from '@/plugins/vuetifyM3ThemeGenerator'
const theme = useTheme()
async function onImageLoad (e: Event) {
const target = e.target as HTMLImageElement
const darkTheme = await vuetifyThemeFromImage(target, true)
const lightTheme = await vuetifyThemeFromImage(target, false)
theme.themes.value.dark.colors = darkTheme.colors
@danielduckworth
danielduckworth / README.md
Last active January 22, 2024 05:22
Conda env pack and move

Conda Pack n' Move

[WIP]

This shell script is used to transfer a Conda environment from one machine to another using rsync and SSH. It first checks if the correct number of arguments is provided, then installs conda-pack if it is not already installed. It then activates the specified Conda environment, packs it, transfers the tar file to the new directory using rsync, unpacks the environment via SSH on the remote machine, updates the .zshrc file, and reloads the shell.

Usage:

  1. Copy the file to ~/bin with cp condapack_n_move.sh ~/bin/condapack_n_move
  2. Make it executable with chmod +x ~/bin/condapack_n_move
@danielduckworth
danielduckworth / installcuda12.sh
Created September 22, 2023 12:50
Install cuda12 toolkit
wget https://developer.download.nvidia.com/compute/cuda/12.0.0/local_installers/cuda_12.0.0_525.60.13_linux.run
bash cuda_12.0.0_525.60.13_linux.run --no-drm --no-man-page --override --toolkitpath=~/local/cuda-12.0/ --toolkit --silent
echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:~/local/cuda-12.0/lib64" >> ~/.bashrc
echo "export PATH=\$PATH:~/local/cuda-12.0/bin" >> ~/.bashrc
source ~/.bashrc
<title>example table</title>