Skip to content

Instantly share code, notes, and snippets.

View noleto's full-sized avatar

Leonardo (Leo) Noleto noleto

View GitHub Profile
@noleto
noleto / ai-access-sovereignty-brainstorm.md
Created April 10, 2026 20:50
AI Access Sovereignty: Technical Independence from Superscale Model Providers

AI Access Sovereignty: Technical Independence from Superscale Model Providers

Drafted: 2026-04-10

Why this note exists

The previous brainstorms (ai-value-p2p-protocol-brainstorm.md and future-of-work-ai-blockchain-p2p-brainstorm.md) explored who captures value when AI does the work, and how a P2P protocol could route that value back to contributing humans.

This note addresses a question that comes before value distribution: who gets to use AI at all?

@noleto
noleto / future-of-work-ai-blockchain-p2p-brainstorm.md
Created March 25, 2026 20:38
Future of Work in the AI Era: My Thoughts and Reflections from Conversations with AI

Future of Work in the AI Era

Drafted: 2026-03-25

Why this note exists

This note captures an evolving thesis about the future of work in the AI era, and extends it into a concrete startup brainstorm at the intersection of AI, blockchain, continuous micro-work, micro-payments, and peer-to-peer value sharing.

The main question is not only whether AI can do most intelligent tasks. The deeper question is: who captures the value when AI does the work, and how can humans still benefit?

@noleto
noleto / parallel_block_dump.py
Created March 7, 2025 22:11
Reading Bitcoin blocks in pseudo parallel using py-bitcoinkernel
from pathlib import Path
from bitcoin.core import CBlock
import pbk
import concurrent.futures
import threading
# ChainstateManager is currently not threadsafe so we need to wrap it
class ThreadSafeChainstateManager:
def __init__(self, chainman):
self.chainman = chainman
@noleto
noleto / install_and_check
Last active March 6, 2025 14:43
py-bitcoinkernel install and check
#!/bin/bash
COMMIT_HASH=${1:-"v0.1.0a2"}
# Install dependencies
apt-get update
apt-get install -y libboost-dev
# Install py-bitcoinkernel from a specific commit
pip install git+https://github.com/stickies-v/py-bitcoinkernel@${COMMIT_HASH}
@noleto
noleto / uci_bank_marketing_dataset_extract_timestamp.py
Last active August 27, 2018 12:45
UCI Bank Marketing Data Set - reverse engineering date from records (not given in the bank-additional-full data set)
## Data set in https://archive.ics.uci.edu/ml/datasets/bank+marketing does not contain timestamp.
## We can "deduce" them from the ordedr of records and use month and day_of_week columns to create a full date
## We know the first record was from 05-05-2008
import pandas as pd
import numpy as np
import datetime as dt
import sys
# read records from May 2008 to November 2010
@noleto
noleto / XGBoost+and+ELI5+-+prediction+does+not+match+sum+of+weights.ipynb
Created August 6, 2018 15:22
XGboost and ELI5 - misleading local feature contribution
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@noleto
noleto / gist:85643da1f7d7e5d5ca43a2308bc4d2f9
Created August 6, 2018 12:58
Plot High Resolution XGBoost Tree
xgb.plot_tree(booster, num_trees=1, rankdir='LR')
fig = matplotlib.pyplot.gcf()
fig.set_size_inches(80, 20)
fig.savefig('tree.png')
@noleto
noleto / lime_local_prediction_manual_calculation.py
Created August 1, 2018 15:39
LIME local prediction computed from weights of features
import numpy as np
import pandas as pd
import xgboost as xgb
from sklearn.model_selection import train_test_split
from sklearn.datasets import make_regression
import lime.lime_tabular
### make data
@noleto
noleto / shap_xgboost.py
Created August 1, 2018 10:39
using SHAP with XGBoost
# coding: utf-8
# In[1]:
### using XGBoost model with SHAP
import numpy as np
import pandas as pd
import xgboost as xgb
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
sudo echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" >> /etc/apt/sources.list.d/docker.list
sudo apt-get update
sudo apt-get purge lxc-docker
sudo apt-cache policy docker-engine
sudo apt-get install docker-engine
sudo service docker start