Skip to content

Instantly share code, notes, and snippets.

View gangchen's full-sized avatar

Gang Chen gangchen

View GitHub Profile
@gangchen
gangchen / svm-rfe.R
Created November 27, 2012 05:56
R implementation of SVM-RFE from literature
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" )
@gangchen
gangchen / gist:4282933
Created December 14, 2012 05:37
Simple samples for R lesson
# 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)
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 / example.py
Last active March 24, 2024 13:28
Tensorflow version for *Machine Learning for Beginners: An Introduction to Neural Networks*
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([
# 其实用可用来问卷星上爬各种公开的带答案的问卷
# 现在这个网址是广东省2022年PCR实验员资格考试的练习题问卷
from requests_html import HTMLSession
wenjuanxing_URL = "https://ks.wjx.top/vm/QqNTNBr.aspx"
def parse_post_data(resp):
print(resp.html.links)