3
I'dログnumpyのこの形式のアレイで理由を以下のコードを理解したいとnumpyのアレイと
print((hypothesis(x, theta_)))
結果
[0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5,
0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5]
を、私はnumpy.log関数を適用します。
print(np.log(hypothesis(x, theta_)))
は、私は次のような結果を得る
[-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718 -0.69314718
-0.69314718 -0.69314718 -0.69314718 -0.69314718]
ログ機能を適用すると、配列の形式が異なるのはなぜですか?
違いは何ですか? – karakfa
出力にコンマはありません –