Skip to content

Instantly share code, notes, and snippets.

import json
from datetime import datetime
import requests
import pickle
import os.path
from googleapiclient.discovery import build
from google_auth_oauthlib.flow import InstalledAppFlow
from google.auth.transport.requests import Request
import groovy.json.JsonOutput
import static groovy.io.FileType.FILES
pipeline {
agent any
stages {
stage('Build') {
steps {
catchError {
sh '$WORKSPACE/run_collection.sh'
import pandas as pd
from sklearn.linear_model import LogisticRegression
def build_model_input():
train_df = pd.read_csv('data/train.csv')
test_df = pd.read_csv('data/test.csv')
df = pd.concat([train_df, test_df])
for col in df.columns:
@Kingkha
Kingkha / roc_auc_score.py
Created November 20, 2019 08:38
calculate roc_auc_score from two numpy ndarray
# Source: http://ethen8181.github.io/machine-learning/model_selection/auc/auc.html#Implementation
def _binary_clf_curve(y_true, y_score):
"""
Calculate true and false positives per binary classification
threshold (can be used for roc curve or precision/recall curve);
the calcuation makes the assumption that the positive case
will always be labeled as 1
Parameters
----------