The Third Level of the Test in Color Coordination
I'm memorizing the contents of "Color Psychology (色彩心理)" now.
Reading Python for Finance
I finished to check the code up to "15.1 Simple Moving Averages (単純移動平均)".
The following are which I couldn't check code smoothly.
In "11.2 Convex Optimization (凸最適化)",
I think the fm(p) function in the book is wrong and intended to be something like this:
def fm(p):
x, y = p
# return (np.sin(x) + 0.05 * x ** 2, np.sin(y) + 0.05 * y ** 2) # original
return np.sin(x) + 0.05 * x ** 2 + np.sin(y) + 0.05 * y ** 2
In "13.1 Normality Tests (正規性検定)",
the argument normed of plt.hist() had been deprecated and replaced to density.
In "13.3 Bayesian Statistics (ベイズ統計)",
the property DataFrame.ix had been deprecated.
DataFrame.iloc is available in this case.
In "13.4.2 Supervised Learning (教師あり学習)", the code in the book use TensorFlow 1.x. I tried to write code using TensorFlow 2.x. The following code worked without error in my environment, but I don't think it is enough to reproduce the original version.
import tensorflow as tf
import logging
tf.get_logger().setLevel(logging.ERROR)
model = tf.keras.models.Sequential([
tf.keras.Input(shape=(2,)),
tf.keras.layers.Dense(64, activation="relu"),
tf.keras.layers.Dense(32, activation="relu"),
tf.keras.layers.Dense(2, activation="softmax"),
])
model.compile(
optimizer='adam',
loss='sparse_categorical_crossentropy',
metrics=['accuracy']
)
X_ = X
y_ = y
model.fit(X_, y_, epochs=5)
I skipped code in "14. The FXCM Trading Platform (FXCMトレーディング プラットフォーム)" because I don't have a FXCM account.