jayhaluska / isolation-forest-js Goto Github PK
View Code? Open in Web Editor NEWIsolation Forest implementation for use in JavaScript
License: MIT License
Isolation Forest implementation for use in JavaScript
License: MIT License
for (let i = 0; i < this.numberOfTrees; i++) {
const subsample = this.getSubsample(this.subsamplingSize);
const iTree: ITree = new ITree(this.X, heightLimit);
this.trees.push(iTree);
}
The subsample result is never used, so subsampling never happens
Hi! Can you perhaps share an example of how to use this module?
I am curious to know what type of data it accepts for example
Thanks for building this package. I keep running into this error, so the pkg cannot work. Please help.
`import {IsolationForest} from 'isolation-forest';
^
SyntaxError: Unexpected token {
at Module._compile (internal/modules/cjs/loader.js:743:23)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:810:10)
at Module.load (internal/modules/cjs/loader.js:666:32)
at tryModuleLoad (internal/modules/cjs/loader.js:606:12)
at Function.Module._load (internal/modules/cjs/loader.js:598:3)
at Function.Module.runMain (internal/modules/cjs/loader.js:862:12)
at `internal/main/run_main_module.js:21:11``
I'd like to request a feature be added so we can score a single new DataObject
from an existing iForest. I believe this can be accomplished by adding a function similar to what's below. Please note I haven't tested this--just typed it out through this ticket and essentially just modified your scores
function.
public score(x: DataObject): number {
let pathLength: number = 0;
for(let j = 0; j < this.numberOfTrees; j++) {
pathLength += this.trees[j].pathLength(x, this.trees[j].getRootNode(), 0)
}
const meanPathLength = pathLength / this.numberOfTrees;
const score = Math.pow(2, -(meanPathLength / averagePathLength(this.subsamplingSize)));
return score;
}
The scores
function could be refactored to call score
if you'd like. If it's helpful I'd be happy to put a PR up.
Thanks for this library! Extremely helpful and easy to use.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.