Skip to content

Instantly share code, notes, and snippets.

View Kirili4ik's full-sized avatar
🌏

Kirill Gelvan Kirili4ik

🌏
View GitHub Profile
@Kirili4ik
Kirili4ik / dataset_utils.py
Created August 1, 2021 21:10
For kws-dla colab
import os
import pandas as pd
from tqdm import tqdm
import torch
import torchaudio
class DatasetDownloader():
def __init__(self, key_word='sheila'):
self.key_word = key_word
@Kirili4ik
Kirili4ik / IV_and_WoE.py
Last active July 21, 2021 13:34
IV and WoE in Python (easy), Information value and Weight of evidence calculations function. Check https://contrib.scikit-learn.org/category_encoders/woe.html
def get_IV(df, feature, target):
lst = []
# optional
# df[feature] = df[feature].fillna("NULL")
unique_values = df[feature].unique()
for val in unique_values:
lst.append([feature, # Feature name
val, # Value of a feature (unique)