Skip to content

Instantly share code, notes, and snippets.

Avatar

Gang Chen gangchen

View GitHub Profile
@gangchen
gangchen / example.py
Last active Jul 14, 2022
Tensorflow version for *Machine Learning for Beginners: An Introduction to Neural Networks*
View example.py
import tensorflow as tf
import numpy as np
data = np.array([
[-2.0, -1], # Alice
[25, 6], # Bob
[17, 4], # Charlie
[-15, -6], # Diana
])
all_y_trues = np.array([
View gist:20bfb7abf6bcf8f15360
All
Abnormality of body height
Multicystic kidney dysplasia
Mode of inheritance
Autosomal dominant inheritance
Autosomal recessive inheritance
Abnormality of female internal genitalia
Functional abnormality of the bladder
Recurrent urinary tract infections
Neurogenic bladder
@gangchen
gangchen / gist:4282933
Created Dec 14, 2012
Simple samples for R lesson
View gist:4282933
# Examples for R training
# Author: Gang Chen <chengang@genomics.cn>
# Nov 2012
# Lesson 2
# vector
a <- c(1, 2, 5, 3, 6, -2, 4)
b <- c("one", "two", "three")
c <- c(TRUE, TRUE, TRUE, FALSE, TRUE, FALSE)
@gangchen
gangchen / svm-rfe.R
Created Nov 27, 2012
R implementation of SVM-RFE from literature
View svm-rfe.R
svmrfeFeatureRanking = function(x,y){
n = ncol(x)
survivingFeaturesIndexes = seq(1:n)
featureRankedList = vector(length=n)
rankedFeatureIndex = n
while(length(survivingFeaturesIndexes)>0){
#train the support vector machine
svmModel = svm(x[, survivingFeaturesIndexes], y, cost = 10, cachesize=500,scale=F, type="C-classification", kernel="linear" )