Skip to content

Instantly share code, notes, and snippets.

@fdabek1
fdabek1 / WipeCommand.php
Created March 11, 2022 06:48
Drop all tenants databases in multi-db version of stancl/tenancy package
<?php
namespace App\Console\Commands;
use Illuminate\Database\Console\WipeCommand as BaseWipeCommand;
class WipeCommand extends BaseWipeCommand
{
/**
* {@inheritdoc}
@fdabek1
fdabek1 / pr_curve.py
Created April 15, 2020 05:04
Generate Precision Recall Curve
from sklearn.metrics import precision_recall_curve, auc, average_precision_score, roc_auc_score
import matplotlib.pyplot as plt
from inspect import signature
def generate_curve(y_true, y_pred):
precision, recall, _ = precision_recall_curve(y_true, y_pred)
average_precision = average_precision_score(y_true, y_pred)
roc_auc = roc_auc_score(y_true, y_pred)
import sys
import time
import numpy as np
class Progbar(object):
def __init__(self, target, width=30, verbose=1, interval=0.01):
'''
@param target: total number of steps expected
@param interval: minimum visual progress update interval (in seconds)