Skip to content

Instantly share code, notes, and snippets.

View davidechicco's full-sized avatar

Davide Chicco davidechicco

View GitHub Profile
@davidechicco
davidechicco / hdbscan_example_single_shot.jl
Last active July 22, 2026 11:24
hdbscan_example_single_shot.jl
using Pkg
# ----------------------------------------------------------
# Install missing packages
# ----------------------------------------------------------
function ensure_package(pkg::String)
try
Base.eval(Main, Meta.parse("using $pkg"))
println("$pkg already available")
@davidechicco
davidechicco / hdbscan_example_hyperparameter_optimization.jl
Last active July 22, 2026 11:22
HDBSCAN and DBCV example test application in Julia
# ==========================================================
# HDBSCAN hyperparameter optimization using DBCV validation
# ==========================================================
using Pkg
# ----------------------------------------------------------
# Install missing packages
# ----------------------------------------------------------
@davidechicco
davidechicco / code_carbon_on_external_script.py
Last active April 2, 2026 14:35
code_carbon_on_external_script.py
#
# Code snippet written by Davide Chicco <davidechicco@davidechicco.it> on 25th March 2026
# Tested on Linux Xubuntu 24.04.4 LTS with Python 3.11.9
#
import subprocess
import sys
import time # <-- Added for timing
# --- Upgrade pip ---
bash_command = sys.executable + " -m pip install --upgrade pip"
#
# Code snippet written by Davide Chicco <davidechicco@davidechicco.it> on 25th March 2026
# Tested on Linux Xubuntu 24.04.4 LTS with Python 3.11.9
#
import subprocess
import sys
import time # <-- Added for timing
# --- Upgrade pip ---
bash_command = sys.executable + " -m pip install --upgrade pip"
@davidechicco
davidechicco / FelSiq_DBCV_test
Last active January 10, 2025 14:01
FelSiq/DBCV test
import pandas as pd
import dbcv
data_file_name = 'DB1.csv'
df = pd.read_csv(data_file_name, header = None)
print("data file name read: ", data_file_name)
clusters_file_name = '../Labels/DB1_786.txt'
clusters = pd.read_csv(clusters_file_name, header = None)
clusters.columns = ['cluster']
# Piece of Python code developed by Davide Chicco on 17th November 2024
# developed for Python 3.11 on Linux Xubuntu 22
# released with creative commons license
# contact: davidechicco@davidechicco.it
import numpy as np
from permetrics import ClusteringMetric
from dbcv import dbcv