python
1コード 2F = t 3Fp = np.full((len(F), len(F[0])), 0.0) 4p = 0.05 5for i in range(len(F)): 6 for j in range(len(F[i])): 7 if F[i][j] < 0.5 - p: 8 Fp[i][j] = 0 9 elif F[i][j] <= 0.5 + p: 10 Fp[i][j] = 0.5 11 else: 12 Fp[i][j] = 1.0 13#pprint.pprint(Fp) 14#距離関数 15m =abs(t-Fp) 16n = np.sum(m) 17d = 2*n/((student*student)-student) 18print(d) 19#表現関数 20o = (len(np.where(Fp==0.5)[0])) 21e = o/((student*student)-student) 22print(e) 23print((d,e)) 24print(abs(d-e))
pが0,0.1,0.2,0.3,0.4,0.5の時のdとeの計算結果を出したいのですがどのようにプログラムを書けばいいのかご指導お願いします。
ちなみにfor文を使いたいです。
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2018/07/12 15:02
2018/07/12 15:06
2018/07/12 15:13