Comments (2)
I agree this could be made more intuitive, but you can currently retrieve the original vector objects via the centroid
property of leaf nodes. So for a given node, you can traverse any children to until you reach the leaves to obtain the vector objects. Example code:
function traverse(node, vectors) {
if (node.left || tree.right) {
if (node.left) traverse(node.left, vectors);
if (node.right) traverse(node.right, vectors);
} else vectors.push(node.centroid);
}
from science.js.
Almost, but not completely. You have the value extracted at index "i" from the vectors parameter but not the index itself. You still have to chase for the index in the vectors argument then.
from science.js.
Related Issues (20)
- loess example is broken
- Create a release? HOT 2
- errors installing with npm 1.1.13 or newer HOT 2
- Mode of single-element arrays is null HOT 1
- mode of same-element arrays is undefined HOT 3
- Build a Bower package HOT 1
- Documentation HOT 3
- Interactive IDE browser app for science.js HOT 2
- Clustering algorithm for graph
- Documentation needed for functions HOT 1
- Error in initialization of hcluster
- Loess -- Returning NaNs. HOT 3
- Stata Lpoly: Can this be replicated in science.js?
- Observable: Invalid module HOT 1
- Documentation?
- .stats.kde() doesn't like multiple repeated values HOT 3
- Choice of license? HOT 3
- Actively Maintained Fork? HOT 2
- hcluster distances are incorrect for complete and average linkage
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from science.js.