K Nearest Neighbours (pure numpy): Revision history

From Master of Neuroscience Wiki

Diff selection: Mark the radio buttons of the revisions to compare and hit enter or the button at the bottom.
Legend: (cur) = difference with latest revision, (prev) = difference with preceding revision, m = minor edit.

17 October 2025

  • curprev 15:4115:41, 17 October 2025 Davrot talk contribs 2,449 bytes +2,449 Created page with "Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Test and train data == <syntaxhighlight lang="python">import numpy as np rng = np.random.default_rng(1) a_x: np.ndarray = rng.normal(1.5, 1.0, size=(1000))[:, np.newaxis] a_y: np.ndarray = rng.normal(3.0, 1.0, size=(1000))[:, np.newaxis] data_train_0: np.ndarray = np.concatenate((a_x, a_y), axis=-1) class_train_0: np.ndarray = np.full((data_train_0.shape[0],), -1) a_x = rng.normal(1.5, 1.0, size=(1000))[:,..." Tag: Visual edit