Skip to content

Instantly share code, notes, and snippets.

View nagarindkx's full-sized avatar

Kanakorn Horsiritham nagarindkx

  • DIDA, Faculty of Medicine, Prince of Songkla Univerity
  • THAILAND
View GitHub Profile
@doraneko94
doraneko94 / roc_auc_ci.py
Last active July 31, 2023 02:36
Calculating confidence interval of ROC-AUC.
from sklearn.metrics import roc_auc_score
from math import sqrt
def roc_auc_ci(y_true, y_score, positive=1):
AUC = roc_auc_score(y_true, y_score)
N1 = sum(y_true == positive)
N2 = sum(y_true != positive)
Q1 = AUC / (2 - AUC)
Q2 = 2*AUC**2 / (1 + AUC)
SE_AUC = sqrt((AUC*(1 - AUC) + (N1 - 1)*(Q1 - AUC**2) + (N2 - 1)*(Q2 - AUC**2)) / (N1*N2))
@flexwie
flexwie / alfio_manual_install.md
Last active August 23, 2023 12:22
How to install Alf.io manually

Alf.io Manual Installation

This is a quick guide on how to install Alf.io manually on a fresh machine.

Prerequisites

The following are neccessay to follow this quick start guide:

  • Server running Ubuntu 16.04
  • Domain pointed to the Server

JDK8

To run Alf.io we need to install the Java Developement Kit 8 (jdk8). First, add Oracles PPA and update the package repository.

@Xophmeister
Xophmeister / ldif2json
Created July 5, 2017 09:34
Quick-and-Dirty LDIF to JSON convertor
#!/usr/bin/env awk -f
# Convert LDIF into JSON
# MIT License
# Copyright (c) 2017 Christopher Harrison
function json_string(str) {
# Convert a string into an escaped JSON string, with enclosing quotes
return "\"" gensub(/"/, "\\\\\"", "g", str) "\""