Commit 392c7cb8 authored by Ying-Qiu Zheng's avatar Ying-Qiu Zheng
Browse files

Update 2021JUL21.md

parent e847ae8b
......@@ -105,7 +105,47 @@ Note that "High+Low" and "Low" are initialised from the same points. "column noi
![res2](/figs/2021JUL21/d10.svg)
## Updates 2020AUG02
## Updates 2020AUG02 - new simulations
```julia
### the high- and low-quality no longer share the same cluster centroid;
### we applied a rotation matrix to the high-quality centroid to get the low-quality centroid
## again suppose there are two clusters, and d features
######## define high quality centroid
XHmean = hcat(randn(Float32, d), randn(Float32, d))
######## generate a random orthogonal matrix and applied it to XHmean
U = qr(randn(d, d))
XLmean = transpose(U.Q) * XHmean
n_samples = 1000
# there are two clusters
class = rand(1:2, n_samples) # this is ytrain
# pre-allocate
XHtrain, XLtrain = [Matrix{Float32}(undef, d, n_samples) for _ 1:2]
###################### simulation I - all features remain informative
# XLtrain is noisier by a factor of noise_level
for c [1, 2]
XHtrain[:, findall(x -> x==c, class)] .= rand(MvNormal(XHmean[:, c], 0.05f0 * I), count(x -> x==c, class))
XLtrain[:, findall(x -> x==c, class)] .= rand(MvNormal(XLmean[:, c], 0.05f0 * noise_level * I), count(x -> x==c, class))
end
###################### simulation II - all features remain informative
XLmean[rand(1:d, Int(round(d * 0.5))), :] .= 0.0f0
# XLtrain is noisier by a factor of noise_level
for c [1, 2]
XHtrain[:, findall(x -> x==c, class)] .= rand(MvNormal(XHmean[:, c], 0.05f0 * I), count(x -> x==c, class))
XLtrain[:, findall(x -> x==c, class)] .= rand(MvNormal(XLmean[:, c], 0.05f0 * noise_level * I), count(x -> x==c, class))
end
###################### simulation III - all features remain informative
# XLtrain is noisier by a factor of noise_level
for c [1, 2]
XHtrain[:, findall(x -> x==c, class)] .= rand(MvNormal(XHmean[:, c], 0.05f0 * I), count(x -> x==c, class))
XLtrain[:, findall(x -> x==c, class)] .= rand(MvNormal(XLmean[:, c], 0.05f0 * noise_level * I), count(x -> x==c, class))
end
XLtrain[:, rand(1:n_samples, Int(round(n_samples / 10)))] .= randn(d, Int(round(n_samples / 10)))
```
### Simulation results
- d = 3
......
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