Skip to content

Instantly share code, notes, and snippets.

View playgrdstar's full-sized avatar

Ming | Gary Ang playgrdstar

View GitHub Profile
@playgrdstar
playgrdstar / Fleishman.py
Created October 10, 2021 13:48 — forked from zeimusu/Fleishman.py
Generate data with given mean, standard deviation, skew, and kurtosis. Intended for monte carlo simulations with non normal distributions
import numpy as np
from numpy.linalg import solve
import logging
logging.basicConfig(level = logging.DEBUG)
from scipy.stats import moment,norm
def fleishman(b, c, d):
"""calculate the variance, skew and kurtois of a Fleishman distribution
F = -c + bZ + cZ^2 + dZ^3, where Z ~ N(0,1)
"""

<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>

Paper and Code Review####

Dressing as a whole: Outfit compatibility learning based on node-wise graph neural networks

Z. Cui, Z. Li, S. Wu, X. Zhang, and L. Wang, WWW 2019

Problem Formulation

  • Set of outfits $S = {s_1, s_2, s_3, ...}$ where each $s_i$ is an outfit, which is a collection of items
  • Each item is $v_i$, the total item set is $V$
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 35 columns, instead of 8. in line 4.
Age,Attrition,BusinessTravel,DailyRate,Department,DistanceFromHome,Education,EducationField,EmployeeCount,EmployeeNumber,EnvironmentSatisfaction,Gender,HourlyRate,JobInvolvement,JobLevel,JobRole,JobSatisfaction,MaritalStatus,MonthlyIncome,MonthlyRate,NumCompaniesWorked,Over18,OverTime,PercentSalaryHike,PerformanceRating,RelationshipSatisfaction,StandardHours,StockOptionLevel,TotalWorkingYears,TrainingTimesLastYear,WorkLifeBalance,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager
41,Yes,Travel_Rarely,1102,Sales,1,2,Life Sciences,1,1,2,Female,94,3,2,Sales Executive,4,Single,5993,19479,8,Y,Yes,11,3,1,80,0,8,0,1,6,4,0,5
49,No,Travel_Frequently,279,Research & Development,8,1,Life Sciences,1,2,3,Male,61,2,2,Research Scientist,2,Married,5130,24907,1,Y,No,23,4,4,80,1,10,3,3,10,7,1,7
37,Yes,Travel_Rarely,1373,Research & Development,2,2,Other,1,4,4,Male,92,2,1,Laboratory Technician,3,Single,2090,NA,6,Y,Yes,15,3,2,80,0,7,3,3,0,0,0,0
33,No,Travel_Frequently,1392,Research & Development,3,4,Lif
month town flat_type block street_name storey_range floor_area_sqm flat_model lease_commence_date
13547 2012-09 CHOA CHU KANG 5 ROOM 119 TECK WHYE LANE 04 TO 06 144 Model A 1989
Survived Pclass Sex Age Fare SibSp Parch
1 2 female 30 21 3 0
1 3 fem 33 15.85 3 0
0 3 female 18 18 2 0
1 1 female 53 51.4792 2 0
1 3 female 23.25 2 0
1 3 female 14 11.2417 1 0
1 2 female 14 30.0708 1 0
0 3 female 14.5 14.4542 1 0
1 3 fem 15 14.4542 1 0
# helper functions for saving sample data and models
# import data loading libraries
import os
import pdb
import pickle
import argparse
import warnings
warnings.filterwarnings("ignore")
import requests, zipfile, io
from pathlib import Path
from shutil import unpack_archive
def download_unzip(url, path = 'content', folder='data'):
zip_file_url = url
folder = folder
data_dir = Path(f'/{path}/{folder}')
data_dir.mkdir(parents=True, exist_ok=True)
zip_fname = data_dir.joinpath(Path(zip_file_url).name)
Sepal.Width Petal.Length Petal.Width Species Sepal.Length
3.5 1.4 0.2 setosa 5.1
3 1.4 0.2 setosa 4.9
3.2 1.3 0.2 setosa 4.7
3.1 1.5 0.2 setosa 4.6
3.6 1.4 0.2 setosa 5.00212766
NA 1.7 0.4 setosa 5.4
3.4 1.4 0.3 setosa 4.6
3.4 1.5 0.2 setosa 5
2.9 1.4 0.2 setosa 4.4
We can make this file beautiful and searchable if this error is corrected: It looks like row 5 should actually have 35 columns, instead of 8. in line 4.
Age,Attrition,BusinessTravel,DailyRate,Department,DistanceFromHome,Education,EducationField,EmployeeCount,EmployeeNumber,EnvironmentSatisfaction,Gender,HourlyRate,JobInvolvement,JobLevel,JobRole,JobSatisfaction,MaritalStatus,MonthlyIncome,MonthlyRate,NumCompaniesWorked,Over18,OverTime,PercentSalaryHike,PerformanceRating,RelationshipSatisfaction,StandardHours,StockOptionLevel,TotalWorkingYears,TrainingTimesLastYear,WorkLifeBalance,YearsAtCompany,YearsInCurrentRole,YearsSinceLastPromotion,YearsWithCurrManager
41,Yes,Travel_Rarely,1102,Sales,1,2,Life Sciences,1,1,2,Female,94,3,2,Sales Executive,4,Single,5993,19479,8,Y,Yes,11,3,1,80,0,8,0,1,6,4,0,5
49,No,Travel_Frequently,279,Research & Development,8,1,Life Sciences,1,2,3,Male,61,2,2,Research Scientist,2,Married,5130,24907,1,Y,No,23,4,4,80,1,10,3,3,10,7,1,7
37,Yes,Travel_Rarely,1373,Research & Development,2,2,Other,1,4,4,Male,92,2,1,Laboratory Technician,3,Single,2090,2396,6,Y,Yes,15,3,2,80,0,7,3,3,0,0,0,0
33,No,Travel_Frequently,1392,Research & Development,3,4,L
@playgrdstar
playgrdstar / titanic_clean.csv
Created October 21, 2019 13:03
Titanic Clean Data
Survived Pclass Fare SibSp Parch Sex Age
1 Yes 2 21 3 0 female 30
2 Yes 3 15.85 3 0 female 33
3 No 3 18 2 0 female 18
4 Yes 1 51.4792 2 0 female 53
5 Yes 3 23.25 2 0 female 30.25347826
6 Yes 3 11.2417 1 0 female 14
7 Yes 2 30.0708 1 0 female 14
8 No 3 14.4542 1 0 female 14.5
9 Yes 3 14.4542 1 0 female 15