From 097b498da67a8caa0f31dd9ef536dd1b2bc2f2d4 Mon Sep 17 00:00:00 2001 From: rstiskalek Date: Sat, 1 Apr 2023 07:16:10 +0100 Subject: [PATCH] Update nb --- notebooks/knn.ipynb | 173 +++++++++++++++++++++++++++++++++----------- 1 file changed, 129 insertions(+), 44 deletions(-) diff --git a/notebooks/knn.ipynb b/notebooks/knn.ipynb index 8ebdb6d..c99dbb6 100644 --- a/notebooks/knn.ipynb +++ b/notebooks/knn.ipynb @@ -2,12 +2,12 @@ "cells": [ { "cell_type": "code", - "execution_count": 4, + "execution_count": 1, "id": "5a38ed25", "metadata": { "ExecuteTime": { - "end_time": "2023-03-31T17:09:12.165480Z", - "start_time": "2023-03-31T17:09:12.116708Z" + "end_time": "2023-04-01T06:10:36.618752Z", + "start_time": "2023-04-01T06:10:10.251616Z" }, "scrolled": true }, @@ -16,8 +16,7 @@ "name": "stdout", "output_type": "stream", "text": [ - "The autoreload extension is already loaded. To reload it, use:\n", - " %reload_ext autoreload\n" + "not found\n" ] } ], @@ -44,12 +43,12 @@ }, { "cell_type": "code", - "execution_count": 5, + "execution_count": 4, "id": "4218b673", "metadata": { "ExecuteTime": { - "end_time": "2023-03-31T17:09:13.943312Z", - "start_time": "2023-03-31T17:09:12.167027Z" + "end_time": "2023-04-01T06:10:44.171672Z", + "start_time": "2023-04-01T06:10:42.109733Z" } }, "outputs": [], @@ -59,12 +58,11 @@ }, { "cell_type": "code", - "execution_count": 11, + "execution_count": null, "id": "5ff7a1b6", "metadata": { "ExecuteTime": { - "end_time": "2023-03-31T17:10:18.303240Z", - "start_time": "2023-03-31T17:10:14.674751Z" + "start_time": "2023-04-01T06:12:15.998Z" } }, "outputs": [ @@ -75,36 +73,6 @@ "\r", " 0%| | 0/1 [00:00rvised.NearestNeighbors'>\n", + "X ndarray 10000000x3: 30000000 elems, type `float32`, 120000000 bytes (114.44091796875 Mb)\n", + "cat HaloCatalogue object at 0x7fbbc6073fa0>\n", + "cdf ndarray 2x9999: 19998 elems, type `float32`, 79992 bytes\n", + "csiborgtools module siborgtools/__init__.py'>\n", + "joblib module ages/joblib/__init__.py'>\n", + "knn NearestNeighbors NearestNeighbors()\n", + "knncdf kNN_CDF object at 0x7fbbc68bb5b0>\n", + "matplotlib module /matplotlib/__init__.py'>\n", + "np module kages/numpy/__init__.py'>\n", + "plt module es/matplotlib/pyplot.py'>\n", + "rs ndarray 9999: 9999 elems, type `float64`, 79992 bytes\n", + "sys module \n", + "tqdm type \n" + ] + } + ], + "source": [ + "%whos" ] }, { "cell_type": "code", "execution_count": null, - "id": "08321431", + "id": "8b9a8cf0", "metadata": {}, "outputs": [], "source": [] }, + { + "cell_type": "code", + "execution_count": null, + "id": "a1825f00", + "metadata": { + "ExecuteTime": { + "end_time": "2023-04-01T06:01:29.388586Z", + "start_time": "2023-04-01T06:01:29.321025Z" + }, + "scrolled": false + }, + "outputs": [], + "source": [ + "plt.figure()\n", + "plt.plot(rs, knncdf.peaked_cdf(cdf[0, :]))\n", + "\n", + "plt.yscale(\"log\" )\n", + "plt.xscale(\"log\")\n", + "plt.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "289549a0", + "metadata": { + "ExecuteTime": { + "end_time": "2023-03-31T22:55:20.690887Z", + "start_time": "2023-03-31T22:55:20.656550Z" + } + }, + "outputs": [], + "source": [ + "mask" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a8c5202", + "metadata": { + "ExecuteTime": { + "end_time": "2023-03-31T22:54:52.330633Z", + "start_time": "2023-03-31T22:54:52.299548Z" + } + }, + "outputs": [], + "source": [] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "46f54897", + "metadata": { + "ExecuteTime": { + "end_time": "2023-03-31T22:54:25.138813Z", + "start_time": "2023-03-31T22:54:25.105044Z" + } + }, + "outputs": [], + "source": [ + "dist" + ] + }, { "cell_type": "code", "execution_count": null,