Skip to content

Instantly share code, notes, and snippets.

View yongkangc's full-sized avatar
🎃
Focusing

Chia Yong Kang yongkangc

🎃
Focusing
View GitHub Profile
@yongkangc
yongkangc / AwesomeButtonActivity_2.java
Last active February 3, 2019 11:07 — forked from CodyEngel/AwesomeButtonActivity_2.java
OnClickMethod-Android
public class AwesomeButtonActivity extends AppCompatActivity {
private Button awesomeButton;
private View.OnClickListener awesomeOnClickListener = new View.OnClickListener() {
@Override
public void onClick(View v) {
awesomeButtonClicked();
}
};
public class AwesomeButtonActivity extends AppCompatActivity {
private Button awesomeButton;
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
awesomeButton = new Button(this);
awesomeButton.setOnClickListener(new View.OnClickListener() {
@yongkangc
yongkangc / pipenv_cheat_sheet.md
Last active January 16, 2020 14:37 — forked from bradtraversy/pipenv_cheat_sheet.md
Pipenv cheat sheet for common commands

Pipenv Cheat Sheet

Install pipenv

pip3 install pipenv

Activate

pipenv shell
#confusionmatrix
from sklearn.metrics import confusion_matrix
import numpy as np
def print_confusion_matrix(confusion_matrix, class_names, figsize = (10,7), fontsize=14, normalize=False):
if normalize:
confusion_matrix = confusion_matrix.astype('float') / confusion_matrix.sum(axis=1)[:, np.newaxis]
fmt = '.2f'
title = 'Normalized Confusion Matrix'
@yongkangc
yongkangc / lda_kmeans.ipynb
Created April 2, 2020 08:18
LDA_KMeans.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / lda_kmeans.ipynb
Created April 30, 2020 05:45
LDA_KMeans.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / hierachical.ipynb
Created April 30, 2020 07:48
Hierachical.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / pytorch_cnn_from_scratch.ipynb
Created June 9, 2021 15:52
Pytorch_CNN_from_scratch.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / transfer-learning-cnn-tutorial.ipynb
Last active June 9, 2021 16:15
transfer learning cnn tutorial.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@yongkangc
yongkangc / Model.py
Created December 10, 2021 15:16
Linear Regression Code Template
#importing the required packages
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
import seaborn as sns
import statsmodels.api as sm
def normalize_z(dfin):
dfout = (dfin - dfin.mean(axis=0))/dfin.std(axis=0)
return dfout