Commit 106e8146 authored by lucas_miranda's avatar lucas_miranda
Browse files

Modified cluster purity computation. Instead of KNN, we now look at...

Modified cluster purity computation. Instead of KNN, we now look at neighborhoods of a predefined radius
parent ba61a305
Pipeline #95661 passed with stages
......@@ -266,3 +266,19 @@ def test_find_learning_rate():
test_model.build(X.shape)
deepof.model_utils.find_learning_rate(test_model, X, y)
def test_neighbor_cluster_purity():
X = np.random.uniform(0, 10, [1500, 5])
y = np.random.randint(0, 2, [1500, 1])
test_model = tf.keras.Sequential()
test_model.add(tf.keras.layers.Dense(1))
test_model.compile(
loss=tf.keras.losses.binary_crossentropy,
optimizer=tf.keras.optimizers.SGD(),
)
test_model.build(X.shape)
test_model.fit(X, y, callbacks=deepof.model_utils.neighbor_cluster_purity())
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment