Skip to content

Instantly share code, notes, and snippets.

Avatar
🎯
Focusing

Cristian Consonni CristianCantoro

🎯
Focusing
View GitHub Profile
View rsnapshot.excludes
+ /home
+ /var
- /dev
- /home/*/.cache/*
- /home/*/.local/share/Trash
- /home/*/.mozilla/firefox/*/Cache
- /mnt
- /proc
- /run
- /selinux
@CristianCantoro
CristianCantoro / rsync.excludes
Last active Dec 11, 2021
rsync full-system backup excludes file
View rsync.excludes
*.!Sync
*.bak
*.bts
*.Cache
*.crdownload
*.lock
*.part
*.shm
*.swp
*.sync
@CristianCantoro
CristianCantoro / README.md
Created Jun 20, 2021
Catboost: from RawFormulaVal to probabilities for Mullticlassification
View README.md

How to calculte class probabilities from RawFormulaVal in Multiclassification problems with Catboost

you get probabilities for the i-th test case by doing:

np.exp(preds_raw[i])/sum(np.exp(preds_raw[i])

Example:

ipdb> preds_raw = model.predict(test_pool, prediction_type='RawFormulaVal')
@CristianCantoro
CristianCantoro / generate.sh
Last active Mar 5, 2021
Compression efficiency comparison
View generate.sh
#!/usr/bin/env bash
SOURCED=false && [ "$0" = "$BASH_SOURCE" ] || SOURCED=true
if ! $SOURCED; then
set -euo pipefail
IFS=$'\n\t'
fi
tmpdir=$(realpath "$(mktemp -d -t test.tmp.XXXXXXXXXX)")
@CristianCantoro
CristianCantoro / # perl - 2020-04-20_19-14-27.txt
Created Apr 20, 2020
perl on Ubuntu 16.04.6 LTS - Homebrew build logs
View # perl - 2020-04-20_19-14-27.txt
Homebrew build logs for perl on Ubuntu 16.04.6 LTS
Build date: 2020-04-20 19:14:27
@CristianCantoro
CristianCantoro / # perl - 2020-04-11_22-16-42.txt
Created Apr 17, 2020
perl on Ubuntu 16.04.6 LTS - Homebrew build logs
View # perl - 2020-04-11_22-16-42.txt
Homebrew build logs for perl on Ubuntu 16.04.6 LTS
Build date: 2020-04-11 22:16:42
@CristianCantoro
CristianCantoro / excludes.txt
Last active Mar 10, 2020
Default exclude file for backing up a full filesystem
View excludes.txt
#
# note: this is run with the option `--one-file-system`, so it takes care
# of /dev, /sys, /proc, /media. Otherwise add those paths to this list.
# restic exclude patterns
*.!Sync
*.Cache
*.SyncOld
*.SyncPart
*.SyncTemp
*.bak
@CristianCantoro
CristianCantoro / # libproxy - 2018-10-27_16-27-17.txt
Created Oct 27, 2018
libproxy on Ubuntu 16.04.5 LTS - Homebrew build logs
View # libproxy - 2018-10-27_16-27-17.txt
Homebrew build logs for libproxy on Ubuntu 16.04.5 LTS
Build date: 2018-10-27 16:27:17
@CristianCantoro
CristianCantoro / example.py
Last active Jun 27, 2018
Using docopts for bash and docopt for python
View example.py
#!/usr/bin/env python3
"""
Usage:
example.sh [options]
example.sh ( -h | --help )
example.sh ( --version )
Options:
-a, --all An optional flaag.
-b Another optional flag.
@CristianCantoro
CristianCantoro / scoping.sh
Last active May 31, 2018
Variable scoping in bash
View scoping.sh
#!/bin/bash
function hello() {
local fname="$1"
echo "Ciao, $fname"
}
echo "Ereditato dal terminale"
echo "\$USER: $USER"