Skip to content

Instantly share code, notes, and snippets.

Avatar

goldan goldan

View GitHub Profile
@joeyAghion
joeyAghion / mongodb_collection_sizes.js
Last active Jun 13, 2022
List mongodb collections in descending order of size. Helpful for finding largest collections. First number is "size," second is "storageSize."
View mongodb_collection_sizes.js
var collectionNames = db.getCollectionNames(), stats = [];
collectionNames.forEach(function (n) { stats.push(db[n].stats()); });
stats = stats.sort(function(a, b) { return b['size'] - a['size']; });
for (var c in stats) { print(stats[c]['ns'] + ": " + stats[c]['size'] + " (" + stats[c]['storageSize'] + ")"); }
@julienr
julienr / sklearn_classif_report_to_latex.py
Created Oct 26, 2015
Parse and convert scikit-learn classification_report to latex
View sklearn_classif_report_to_latex.py
"""
Code to parse sklearn classification_report
"""
##
import sys
import collections
##
def parse_classification_report(clfreport):
"""
Parse a sklearn classification report into a dict keyed by class name