Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Loading fitted model to transform later #81

@josesho

Description

@josesho

I want to basically transform additional points after performing an initial fitting, but with a fitted model I load instead of one I just generated.

I tried to use class-transformer but got several errors.

So I tried the "manual" method of using JSON.stringify() on a already fitted UMAP model, then

const new = new UMAP({
    nComponents: 2,
    minDist: 0.5,
    scale: 1,
    nNeighbors: 2,
    distanceFn: dist.similarity.manhattan
  });

  Object.keys(loaded).map((x) => (n[x] = stringfiedUMAP[x]));

This new object does have an transform function as expected, but calling it with

n.transform([myNewVector])

gives the error

TypeError: initFromRandom is not a function

Any help or tips here would be appreciated! Ideally it would be nice to be able to load a prefitted UMAP and transform new data points, just like MacInnes' Python implementation.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions