Skip to content

Instantly share code, notes, and snippets.

View thierrymoudiki's full-sized avatar

Thierry Moudiki thierrymoudiki

View GitHub Profile
@thierrymoudiki
thierrymoudiki / get-diebold-li-2006.R
Last active May 16, 2026 05:24
Get Diebold-Li (2006) data
url <- "https://raw.githubusercontent.com/Techtonique/datasets/refs/heads/main/time_series/multivariate/dieboldli2006.txt"
parse_time_series_url <- function(url) {
response <- httr::GET(url)
content <- httr::content(response, "text")
lines <- strsplit(content, "\n")[[1]]
data_list <- list()
for (line in lines) {
@thierrymoudiki
thierrymoudiki / submit_PyPI.md
Created May 10, 2026 14:27
Submit to PyPI at the command line

Uploading a Python Package to PyPI from the Command Line

1. Install packaging tools

pip install -U build twine setuptools wheel

@thierrymoudiki
thierrymoudiki / figures.tex
Created January 12, 2026 04:00
figures in LaTeX
\begin{figure}[ht]
\centering
\includegraphics[width=0.9\textwidth]{figure5_model_comparison_summary.pdf}
\caption{Comprehensive model comparison...}
\end{figure}
@thierrymoudiki
thierrymoudiki / gist:1894dffe30a83cb1be9537e9ec6b5b22
Created January 10, 2026 12:52
generate the SHA256 hash for conda pkg
curl -sL https://github.com/owner/repo/archive/refs/tags/vX.X.X.tar.gz | openssl sha256
@thierrymoudiki
thierrymoudiki / code.R
Created January 8, 2026 09:54
formulas vs matrix interface
#' Convert formula-based model function to matrix interface
#'
#' @param fit_func Function accepting formula and data
#' @param predict_func Optional prediction function
#' @param intercept Include intercept in formula (default TRUE)
#' @return List with fit and predict methods
formula_to_matrix <- function(fit_func, predict_func = NULL, intercept = TRUE) {
fit_wrapper <- function(X, y, ...) {
# Input validation
@thierrymoudiki
thierrymoudiki / bayesopt.R
Last active January 21, 2026 14:59
Bayesian optimization using bayesianrvfl::bayes_opt
# Run Bayesian optimization minimizing rmse
remotes::install_github("thierrymoudiki/bayesianrvfl")
> head(bayesianrvfl::bayes_opt)
# function (objective, lower, upper, type_acq = c("ei", "ucb"),
# nb_init = 10L, nb_iter = 90L, kappa = 1.96, method = c("standard",
# "direct_online", "polyak_online"), surrogate_model = c("rvfl",
# "matern52", "rvfl_emcee", "rf"), optim_surr = c("GCV",
@thierrymoudiki
thierrymoudiki / loop_sklearn_models.py
Last active December 13, 2025 18:27
Loop on all sklearn models
from sklearn.utils import all_estimators
from tqdm import tqdm
# Get all scikit-learn regressors
estimators = all_estimators(type_filter='regressor')
for name, RegressorClass in tqdm(estimators):
if name in ['MultiOutputRegressor', 'MultiOutputClassifier', 'StackingRegressor', 'StackingClassifier',
@thierrymoudiki
thierrymoudiki / doSNOW.R
Created October 3, 2025 07:31 — forked from andrie/doSNOW.R
Progress bars with foreach and doSNOW
library(doSNOW)
library(tcltk)
cl <- makeSOCKcluster(2)
registerDoSNOW(cl)
pb <- txtProgressBar(max=100, style=3)
progress <- function(n) setTxtProgressBar(pb, n)
opts <- list(progress=progress)
r <- foreach(i=1:100, .options.snow=opts) %dopar% {
#!/bin/bash
# first, install jq: on macOS, brew install jq
wget https://raw.githubusercontent.com/Techtonique/datasets/refs/heads/main/tabular/survival/gbsg2_2.csv
# === CONFIG ===
JSON_FILE="survival_curves.json"
CSV_FILE="survival_curves.csv"
PLOT_FILE="survival_plot.png"