{ "cells": [ { "cell_type": "code", "execution_count": 1, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:28:59.747542Z", "iopub.status.busy": "2024-04-17T07:28:59.747461Z", "iopub.status.idle": "2024-04-17T07:29:00.067332Z", "shell.execute_reply": "2024-04-17T07:29:00.067114Z" } }, "outputs": [ { "data": { "text/html": [ "\n", "
\n", " \n", " " ] }, "metadata": {}, "output_type": "display_data" } ], "source": [ "import numpy as np\n", "from lets_plot import *\n", "\n", "LetsPlot.setup_html()" ] }, { "cell_type": "code", "execution_count": 2, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:29:00.081010Z", "iopub.status.busy": "2024-04-17T07:29:00.080830Z", "iopub.status.idle": "2024-04-17T07:29:00.082544Z", "shell.execute_reply": "2024-04-17T07:29:00.082357Z" } }, "outputs": [], "source": [ "np.random.seed(42)" ] }, { "cell_type": "code", "execution_count": 3, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:29:00.083747Z", "iopub.status.busy": "2024-04-17T07:29:00.083592Z", "iopub.status.idle": "2024-04-17T07:29:00.086160Z", "shell.execute_reply": "2024-04-17T07:29:00.085957Z" } }, "outputs": [], "source": [ "cov0=[[1, -.8], \n", " [-.8, 1]] \n", "cov1=[[1, .8], \n", " [.8, 1]] \n", "cov2=[[ 10, .1],\n", " [.1, .1]]\n", "\n", "x0, y0 = np.random.multivariate_normal(mean=[-2,0], cov=cov0, size=400).T\n", "x1, y1 = np.random.multivariate_normal(mean=[2,0], cov=cov1, size=400).T\n", "x2, y2 = np.random.multivariate_normal(mean=[0,1], cov=cov2, size=400).T\n", "\n", "data = dict(\n", " x = np.concatenate((x0,x1,x2)),\n", " y = np.concatenate((y0,y1,y2))\n", ")" ] }, { "cell_type": "code", "execution_count": 4, "metadata": { "execution": { "iopub.execute_input": "2024-04-17T07:29:00.087193Z", "iopub.status.busy": "2024-04-17T07:29:00.087077Z", "iopub.status.idle": "2024-04-17T07:29:00.123521Z", "shell.execute_reply": "2024-04-17T07:29:00.123325Z" } }, "outputs": [ { "data": { "text/html": [ " \n", " " ], "text/plain": [ "