Skip to content

Instantly share code, notes, and snippets.

View roma-glushko's full-sized avatar
🦁

Roman Glushko roma-glushko

🦁
View GitHub Profile
import shap
shap.initjs()
# Create object that can calculate shap values
explainer = shap.TreeExplainer(rf_classifier)
# Calculate Shap values
shap_values = explainer.shap_values(X_test, y_test)
@roma-glushko
roma-glushko / heapify.py
Last active May 26, 2021 08:22
Implementation of heap (priority queue) from my blog post: https://www.romaglushko.com/blog/heapify/
from typing import List
class PriorityQueue:
"""
Represents the heap and preserves the heap property during adding/removing elements
"""
items: List[int]
def __init__(self, items: List[int]):
@roma-glushko
roma-glushko / git-branch-clean-up.sh
Last active October 29, 2021 07:47
Remove all local branches that don't exist on the remote anymore (works with rebase merging strategy)
git fetch -p
git branch -r | awk '{print $1}' | egrep -v -f /dev/fd/0 <(git branch -vv | grep origin) | awk '{print $1}' | xargs git branch -D
@roma-glushko
roma-glushko / keybase.md
Created June 10, 2022 16:50
keybase.md

Keybase proof

I hereby claim:

  • I am roma-glushko on github.
  • I am roman_hlushko (https://keybase.io/roman_hlushko) on keybase.
  • I have a public key ASBcxKOVsMVXbXS77Zpa1eCY0wk9aevojXoGVI5KQEhd9wo

To claim this, I am signing this object: