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
@nagarindkx
nagarindkx / roc_auc_ci.py
Created December 20, 2022 05:54 — forked from doraneko94/roc_auc_ci.py
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))
@nagarindkx
nagarindkx / zoom web hook callback
Created July 28, 2021 08:20
Python code for Google Cloud Function to alert via LINE Notify by zoom webhook event
import requests
def callback(request):
zoom_verification_token="ZOON_VERIFICATION_TOKEN"
access_token='LINE_NOTIFY_TOKEN'
re_auth=request.headers['authorization']
#if re_auth == zoom_verification_token:x
if re_auth == re_auth:
notify_url = 'https://notify-api.line.me/api/notify'
header={
@nagarindkx
nagarindkx / moveFilesFromDriveToShareDrive.gs
Created May 21, 2021 16:12
Move large amount of files from a single Google Drive folder to Shared Drives
function moveFilesFromDriveToShareDrive() {
/*
Created by: Kanakorn Horsiritham
Digital Innovation and Data Analytics (DIDA)
Faculty of Medicine
Prince of Songkla University
Hatyai, Songkhla
THAILAND
*/
sourceFS=DriveApp.getFolderById('GoogleDrive-Folder-ID').getFiles()
@nagarindkx
nagarindkx / copyFilesFromDriveToShareDrive.gs
Last active May 31, 2021 08:21
Copy File and Subfolder from My Drive folder to Shared Drives
function copyFilesFromDriveToShareDrive() {
/*
Created by: Kanakorn Horsiritham
Digital Innovation and Data Analytics (DIDA)
Faculty of Medicine
Prince of Songkla University
Hatyai, Songkhla
THAILAND
*/
@nagarindkx
nagarindkx / kxmailmerge.gs
Created November 28, 2016 05:36
Totally Free Google Sheet Mail Merge
/*
* KX MailMerge
* Developer: Kanakorn Horsiritham
* Computer Center, Prince of Songkla University
* Hat Yai, Songkhla, THAILAND
* Create Date: 2016-11-28
* Website: http://sysadmin.psu.ac.th/author/kanakorn-h/
*/
# Test
echo "Hello World"