[Solution] Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep…

Original Source Here

[Solution] Introduction to TensorFlow for Artificial Intelligence, Machine Learning, and Deep Learning

Exercise 1 (Housing Prices)

Note: No need add “*100000” at return line because of the hint (I was stuck here).

# GRADED FUNCTION: house_model
def house_model(y_new):
xs = np.array([1., 2., 3., 4., 5., 6.], dtype=float)
ys = np.array([1., 1.5, 2., 2.5, 3., 3.5], dtype=float)
model = tf.keras.Sequential([keras.layers.Dense(units=1, input_shape=[1])])
model.compile(optimizer="sgd", loss="mean_squared_error")
model.fit(xs, ys, epochs=500)
return model.predict(y_new)[0]

AI/ML

Trending AI/ML Article Identified & Digested via Granola by Ramsey Elbasheer; a Machine-Driven RSS Bot

%d bloggers like this: