Skip to content

Instantly share code, notes, and snippets.

@jjongjjong
jjongjjong / knn_impute.py
Created September 14, 2019 14:31 — forked from YohanObadia/knn_impute.py
Imputation of missing values with knn.
import numpy as np
import pandas as pd
from collections import defaultdict
from scipy.stats import hmean
from scipy.spatial.distance import cdist
from scipy import stats
import numbers
def weighted_hamming(data):
@jjongjjong
jjongjjong / knn_impute.py
Created September 14, 2019 14:31 — forked from YohanObadia/knn_impute.py
Imputation of missing values with knn.
import numpy as np
import pandas as pd
from collections import defaultdict
from scipy.stats import hmean
from scipy.spatial.distance import cdist
from scipy import stats
import numbers
def weighted_hamming(data):
@jjongjjong
jjongjjong / weight_init.py
Created September 26, 2019 05:16 — forked from jeasinema/weight_init.py
A simple script for parameter initialization for PyTorch
#!/usr/bin/env python
# -*- coding:UTF-8 -*-
import torch
import torch.nn as nn
import torch.nn.init as init
def weight_init(m):
'''