User contributions for Davrot
From Master of Neuroscience Wiki
17 October 2025
- 15:4215:42, 17 October 2025 diff hist −15 VS Code Microsoft Tutorials No edit summary current Tag: Visual edit
- 15:4215:42, 17 October 2025 diff hist −15 VS Code configuration No edit summary current Tag: Visual edit
- 15:4215:42, 17 October 2025 diff hist −15 VS Code installation No edit summary current Tag: Visual edit
- 15:4115:41, 17 October 2025 diff hist −132 Python installation No edit summary current Tag: Visual edit
- 15:4115:41, 17 October 2025 diff hist +2,449 N K Nearest Neighbours (pure numpy) 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))[:,..." current Tag: Visual edit
- 15:4015:40, 17 October 2025 diff hist +3,606 N ROC (pure numpy) Created page with "Questions to [mailto:davrot@uni-bremen.de David Rotermund] The following code is for the case where the amount of data for both classes is the same. == Test data == <syntaxhighlight lang="python">import numpy as np import matplotlib.pyplot as plt rng = np.random.default_rng(1) a_x = rng.normal(1.5, 1.0, size=(5000)) b_x = rng.normal(0.0, 1.0, size=(5000)) ab_x = np.concatenate([a_x, b_x]) edges = np.histogram_bin_edges(ab_x, bins=100, range=None, weights=None) h_a..." current Tag: Visual edit
- 15:3915:39, 17 October 2025 diff hist +4 N File:15 1.png No edit summary current
- 15:3915:39, 17 October 2025 diff hist +4 N File:15 2.png No edit summary current
- 15:3915:39, 17 October 2025 diff hist +4 N File:15 3.png No edit summary current
- 15:3815:38, 17 October 2025 diff hist +115 Python Tutorial →Sci-kit Learn Tag: Visual edit
- 15:3615:36, 17 October 2025 diff hist +4,916 N Support Vector Machine Created page with "== Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://scikit-learn.org/stable/modules/generated/sklearn.svm.SVC.html sklearn.svm.SVC] == <syntaxhighlight lang="python">sklearn.svm.SVC(*, C=1.0, kernel='rbf', degree=3, gamma='scale', coef0=0.0, shrinking=True, probability=False, tol=0.001, cache_size=200, class_weight=None, verbose=False, max_iter=-1, decision_function_shape='ovr', break_ties=False, random_state=None)</syntaxhighlight><blockquo..." Tag: Visual edit
- 15:3515:35, 17 October 2025 diff hist +9,755 N FastICA Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Test data == We rotate the blue dots with a non-orthogonal rotation matrix into the red dots.<syntaxhighlight lang="python">import numpy as np import matplotlib.pyplot as plt rng = np.random.default_rng(1) a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3 data_a = np.concatenate((a_x, a_y), axis=1) b_x = rng.normal(0.0, 1.0,..." Tag: Visual edit
- 15:3515:35, 17 October 2025 diff hist +4 N File:14 0.png No edit summary current
- 15:3415:34, 17 October 2025 diff hist +4 N File:14 1.png No edit summary current
- 15:3315:33, 17 October 2025 diff hist +4 N File:14 2.png No edit summary current
- 15:3315:33, 17 October 2025 diff hist +4 N File:14 3.png No edit summary current
- 15:0815:08, 17 October 2025 diff hist +12,353 N PCA Created page with "== The goal == PCA allows to extract an orthogonal basis system for a set of data. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Test data == <syntaxhighlight lang="python">import numpy as np import matplotlib.pyplot as plt rng = np.random.default_rng(1) a_x = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] a_y = rng.normal(0.0, 1.0, size=(5000))[:, np.newaxis] ** 3 data_a = np.concatenate((a_x, a_y), axis=1) b_x = rng.normal(0.0, 1.0, size=(5000))[..." Tag: Visual edit
- 15:0715:07, 17 October 2025 diff hist +4 N File:13 0.png No edit summary current
- 15:0715:07, 17 October 2025 diff hist +4 N File:13 1.png No edit summary current
- 15:0615:06, 17 October 2025 diff hist +4 N File:13 2.png No edit summary current
- 15:0615:06, 17 October 2025 diff hist +4 N File:13 3.png No edit summary current
- 15:0415:04, 17 October 2025 diff hist +9,417 N KMeans Created page with "== The goal == KMeans allows to find clusters in a data set. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Test data == <syntaxhighlight lang="python">import numpy as np import matplotlib.pyplot as plt rng = np.random.default_rng(1) rng = np.random.default_rng() a_x = rng.normal(1.5, 1.0, size=(1000)) a_y = rng.normal(3.0, 1.0, size=(1000)) b_x = rng.normal(0.0, 1.0, size=(1000)) b_y = rng.normal(0.0, 1.0, size=(1000)) plt.plot(a_x, a_y, "c.") plt...." Tag: Visual edit
- 15:0315:03, 17 October 2025 diff hist +4 N File:12 1.png No edit summary current
- 15:0315:03, 17 October 2025 diff hist +4 N File:12 2.png No edit summary current
- 15:0215:02, 17 October 2025 diff hist +4 N File:12 3.png No edit summary current
- 15:0215:02, 17 October 2025 diff hist +4 N File:12 0.png No edit summary current
- 15:0015:00, 17 October 2025 diff hist +50,614 N Sci-kit Overview Created page with "== The goal == [https://scikit-learn.org/stable/index.html scikit-learn] is a machine learning tool kit for data analysis. Questions to [mailto:davrot@uni-bremen.de David Rotermund]<syntaxhighlight lang="shell">pip install scikit-learn</syntaxhighlight><blockquote>* Simple and efficient tools for predictive data analysis * Accessible to everybody, and reusable in various contexts * Built on NumPy, SciPy, and matplotlib </blockquote>'''I will keep it short and I will ma..." Tag: Visual edit
- 14:5614:56, 17 October 2025 diff hist +4,359 N Scipy.signal: Butterworth low, high and band-pass Created page with "== The goal == Sometimes we need to remove of frequency range from a time series. For this we can use a Butterworth filter [https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.butter.html scipy.signal.butter] and the [https://docs.scipy.org/doc/scipy/reference/generated/scipy.signal.filtfilt.html scipy.signal.filtfilt] command. Questions to [mailto:davrot@uni-bremen.de David Rotermund] {| class="wikitable" |[https://docs.scipy.org/doc/scipy/reference/gener..." Tag: Visual edit
- 14:5614:56, 17 October 2025 diff hist +4 N File:11 4.png No edit summary current
- 14:5514:55, 17 October 2025 diff hist +4 N File:11 3.png No edit summary current
- 14:5514:55, 17 October 2025 diff hist +4 N File:11 2.png No edit summary current
- 14:5514:55, 17 October 2025 diff hist +4 N File:11 1.png No edit summary current
- 14:5214:52, 17 October 2025 diff hist +3,935 N Remove a common signal from your data with SVD Created page with "== Goal == We want to remove a common signal which was mixed on top a set of data channels. There are many methods to do so. We will use SVD. Implementations are for example: [https://docs.scipy.org/doc/scipy/reference/generated/scipy.linalg.svd.html scipy.linalg.svd] or [https://pytorch.org/docs/stable/generated/torch.svd_lowrank.html torch.svd_lowrank] (which also works on the GPU) Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Creating dirty test data..." Tag: Visual edit
- 14:5214:52, 17 October 2025 diff hist +4 N File:10 5.png No edit summary current
- 14:5114:51, 17 October 2025 diff hist +4 N File:10 4.png No edit summary current
- 14:5014:50, 17 October 2025 diff hist +4 N File:10 3.png No edit summary current
- 14:5014:50, 17 October 2025 diff hist +4 N File:10 2.png No edit summary current
- 14:5014:50, 17 October 2025 diff hist +4 N File:10 1.png No edit summary current
- 14:4614:46, 17 October 2025 diff hist −117 Subplots and gridspec: A more flexible placement →subplots and gridspec Tag: Visual edit
- 14:4614:46, 17 October 2025 diff hist +3 N File:9 3.png No edit summary current
- 14:4514:45, 17 October 2025 diff hist +3 N File:9 2.png No edit summary current
- 14:4514:45, 17 October 2025 diff hist +3 N File:9 1.png No edit summary current
- 14:3614:36, 17 October 2025 diff hist +12,677 N Subplots and gridspec: A more flexible placement Created page with " = subplots and gridspec = {:.no_toc} <nav class="toc-class"> * TOC {:toc} </nav> == Top == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Example 1 (2d regular grid) == '''subplots with s at the end!!!'''<syntaxhighlight lang="python">import numpy as np import matplotlib.pylab as plt rng = np.random.default_rng() a = rng.random((100, 100)) fig, axs = plt.subplots(nrows=3, ncols=3) print(axs.shape) # -> (3, 3) for x in range(0, axs.shape[0]):..." Tag: Visual edit
- 14:3514:35, 17 October 2025 diff hist +15,466 N Overview of the available functions Created page with "== The goal == There a lot of functions in matplotlib.pyplot. Here I list the more important ones. Questions to [mailto:davrot@uni-bremen.de David Rotermund]<blockquote>'''pylab''' is a historic interface and '''its use is strongly discouraged'''. The equivalent replacement is matplotlib.pyplot</blockquote> == [https://matplotlib.org/stable/api/pyplot_summary.html#managing-figure-and-axes Managing Figure and Axes] == {| class="wikitable" |[https://matplotlib.org/stable..." Tag: Visual edit
- 14:3314:33, 17 October 2025 diff hist +9,812 N Animation and Slider Created page with "== The goal == Sometimes a static picture is not enough. Here we will produce an animation from data as well as make data interactively inspectable. Questions to [mailto:davrot@uni-bremen.de David Rotermund] == Test data == <syntaxhighlight lang="python">import numpy as np import matplotlib.pyplot as plt axis = np.arange(-100, 101) / 100.0 x = axis[:, np.newaxis, np.newaxis].copy() y = axis[np.newaxis, :, np.newaxis].copy() z = axis[np.newaxis, np.newaxis, :].copy()..." Tag: Visual edit
- 14:3214:32, 17 October 2025 diff hist +3 N File:8 0.png No edit summary current
- 14:3114:31, 17 October 2025 diff hist +3 N File:8 1.gif No edit summary current
- 14:2914:29, 17 October 2025 diff hist +4,126 N Subplot Created page with "== The goal == Questions to [mailto:davrot@uni-bremen.de David Rotermund] == [https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.subplot.html matplotlib.pyplot.subplot] == <syntaxhighlight lang="python">matplotlib.pyplot.subplot(*args, **kwargs)</syntaxhighlight><blockquote>Add an Axes to the current figure or retrieve an existing Axes. This is a wrapper of Figure.add_subplot which provides additional behavior when working with the implicit API (see the notes..." Tag: Visual edit
- 14:2914:29, 17 October 2025 diff hist +3 N File:7 0.png No edit summary current
- 14:2814:28, 17 October 2025 diff hist +3 N File:7 1.png No edit summary current