Commit 1ab9e709 authored by Ying-Qiu Zheng's avatar Ying-Qiu Zheng
Browse files

Update 2021JUN20.md

parent 3c80e712
......@@ -46,14 +46,14 @@ d = 1500 # number of features
# generate feature matrices - high quality
Xtrain, Xtest = (randn(n, d) for _ 1:2)
# low quality -- some columns are noisier
noise_col = rand(1:d, Int(d * 0.2)) # 20% of the columns are noiser
noise_col = rand(1:d, Int(d * 0.2)) # 20% of the columns of XL are noiser
XLtrain = copy(Xtrain)
XLtrain[:, noise_col] .+= randn(n, Int(d * 0.2))
XLtest = copy(Xtest)
XLtest[:, noise_col] .+= randn(n, Int(d * 0.2))
[x .= exp.(x) for x [Xtrain, Xtest, XLtrain, XLtest]]
# generate high quality coefficients - 60% of the coefficients are zeros.
# generate high quality coefficients - 60% of the coefficients w are zeros.
w=randn(d); w[rand(1:d, Int(d*0.6))] .= 0.
ytrain= logistic.(Xtrain*w); ytest = logistic.(Xtest * w)
......@@ -61,7 +61,7 @@ ttrain = [x > 0.5 ? 1 : 0 for x in ytrain]
ttest = [x > 0.5 ? 1: 0 for x in ytest]
# low quality -- some columns are zero
zero_col = rand(1:d, Int(d * 0.05)) # 5% of the columns are zero
zero_col = rand(1:d, Int(d * 0.05)) # 5% of the columns in XL are zero
[x .= exp.(x) for x [Xtrain, Xtest]]
XLtrain = copy(Xtrain)
XLtrain[:, zero_col] .= 0.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment