DruidJS — 차원 축소를 위한 자바스크립트 라이브러리.
DruidJS는 차원 축소를 위한 자바스크립트 라이브러리입니다. 차원 축소를 통해 고차원 데이터를 데이터의 메서드별 특성을 유지하면서 저차원으로 투영할 수 있습니다. DruidJS는 구현된 차원 축소 방법들로 데이터셋을 쉽게 투영할 수 있게 합니다.
자료들
@inproceedings{cutura2020druid,
title={{DRUIDJS — A JavaScript Library for Dimensionality Reduction}},
author={Cutura, Rene and Kralj, Christoph and Sedlmair, Michael},
booktitle={2020 IEEE Visualization Conference (VIS)},
pages={111--115},
year={2020},
organization={IEEE}
}
설치
npm을 사용하는 경우, npm install @saehrimnir/druidjs로 설치하고 다음과 같이 사용하십시오.
import * as druid from "@saehrimnir/druidjs";그렇지 않으면 여기에서 파일을 다운로드하거나, 예를 들어 unpkg를 다음과 같이 사용하세요:
행렬
DruidJS는 내부적으로 데이터를 저장하기 위해 Matrix 클래스를 사용합니다. 예를 들어 from 함수를 사용하여 druid.Matrix 객체를 생성하여 사용할 수 있습니다:
import * as druid from '@saehrimnir/druidjs';let data = [[...], [...], ...];
let matrix = druid.Matrix.from(data);
다음과 같이 프로그래밍 방식으로 druid.Matrix 객체를 생성할 수 있습니다:
let fn = (row, col) => (row == col ? 1 : 0);
let matrix = new druid.Matrix(rows, columns, fn);만약 rows == columns 이면, matrix 는 항등 행렬이 됩니다.
항등 행렬의 단축 표기법은 다음과 같습니다:
let matrix = new druid.Matrix(rows, columns, "I");
// or
let matrix = new druid.Matrix(rows, columnbs, "identity");
행렬을 생성하는 더 많은 단축키가 있습니다:let matrix = new druid.Matrix(3, 3, "zeros"); // matrix would be a 3x3 matrix with zeroes
let matrix = new druid.Matrix(3, 3, "center"); // matrix would be a 3x3 center matrix;
let number = 12;
let matrix = new druid.Matrix(3, 3, number); // matrix would b a 3x3 matrix filled with 'number'예를 들어 d3와 함께 druid.Matrix 객체를 사용하려면, to2dArray 속성, iterate_rows 제너레이터 함수, 또는 단순히 druid.Matrix 객체를 반복 가능(iterable)으로 사용하면 됩니다(버전 6부터 d3에서 작동).
let data = await d3.csv("data.csv");
let matrix = druid.Matrix.from(data);
d3.selectAll("datapoints").data(matrix.to2dArray); //...
d3.selectAll("datapoints").data(matrix.iterate_rows()); //...
d3.selectAll("datapoints").data(matrix); //...DR methods
#### Transform
#### Generator
#### TopoMap Example
Example ...
--- Tranlated By Open Ai Tx | Last indexed: 2026-05-06 ---