This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
p = 0.2 | |
size = 1000 | |
bern = np.random.binominal(1,p, size) | |
zeros = 0 | |
ones = 0 | |
for item in bern: | |
if item == 0: | |
ones += 1 | |
else: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Generate 2 - class problem, using parametric classification | |
import numpy as np | |
den1 = 1 | |
den2 = 0.3 | |
var1 = den1 ** 2 | |
var2 = den2 ** 2 | |
mean1 = 3 | |
mean2 = 2 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
# deviance ve mean buradan giriliyor | |
dev = 10 | |
var = dev ** 2 | |
mean = 3 | |
# örnek kümesinin boyutu | |
size = 150 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
import matplotlib.pyplot as plt | |
x=np.random.randn(10000) | |
## Eğer direk olarak xm = x olarak tanımlanırsa, xm sadece x'in pointer'ını alıyor | |
## Bu şekilde oluşturulduğunda xm değerleri değiştirildiğinde x değerleri de değişeceğinden yanlış sonuçlar alırız | |
xm=list(x); | |
xv=list(x); |
NewerOlder