Options
All
  • Public
  • Public/Protected
  • All
Menu

Class FittedUMAP

Hierarchy

Index

Constructors

constructor

  • new FittedUMAP(input: UMAPParams, embeddings: DeviceBuffer, coo?: COOInterface): FittedUMAP

Properties

_coo

_coo: COOInterface

Initialize a UMAP object

param input:

UMAPParams

param outputType:

'dataframe'|'series'|'devicebuffer'

example:
import {UMAP} from 'rapidsai/cuml';

const umap = new UMAP({nComponents:2}, 'dataframe');

Accessors

a

  • get a(): number

b

  • get b(): number

embeddings

  • get embeddings(): Embeddings<Float32>
  • Returns Embeddings<Float32>

    Embeddings in low-dimensional space in float32 format, which can be converted to any of the following types: DataFrame, Series, DeviceBuffer.

    embeddings.asDataFrame(); // returns DataFrame<{number: Series<Numeric>}>
    embeddings.asSeries(); // returns Series<Numeric>
    embeddings.asDeviceBuffer(); //returns rmm.DeviceBuffer

init

  • get init(): number

initialAlpha

  • get initialAlpha(): number

learningRate

  • get learningRate(): number

localConnectivity

  • get localConnectivity(): number

minDist

  • get minDist(): number

nComponents

  • get nComponents(): number

nEpochs

  • get nEpochs(): number

nNeighbors

  • get nNeighbors(): number

negativeSampleRate

  • get negativeSampleRate(): number

randomState

  • get randomState(): number

repulsionStrength

  • get repulsionStrength(): number

setOpMixRatio

  • get setOpMixRatio(): number

spread

  • get spread(): number

targetMetric

  • get targetMetric(): string

targetNNeighbors

  • get targetNNeighbors(): number

targetWeight

  • get targetWeight(): number

transformQueueSize

  • get transformQueueSize(): number

verbosity

  • get verbosity(): string

Methods

fitArray

  • fitArray<T>(features: (undefined | null | number | bigint)[], target: null | (undefined | null | number | bigint)[], nFeatures?: number, convertDType?: boolean): FittedUMAP
  • Fit features into an embedded space

    Type parameters

    Parameters

    • features: (undefined | null | number | bigint)[]

      array containing floats or doubles in the format [x1, y1, z1, x2, y2, z2...] for features x, y & z.

      // For a sample dataset of colors, with properties r,g and b:
      features = [
      ...Object.values({ r: xx1, g: xx2, b: xx3 }),
      ...Object.values({ r: xx4, g: xx5, b: xx6 }),
      ] // [xx1, xx2, xx3, xx4, xx5, xx6]
    • target: null | (undefined | null | number | bigint)[]

      array containing target values

      // For a sample dataset of colors, with properties r,g and b:
      target = [color1, color2] // len(target) = nFeatures
    • nFeatures: number = 1

      number of properties in the input features, if features is of the format [x1, y1, x2, y2...]

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns FittedUMAP

    FittedUMAP object with updated embeddings

fitDataFrame

  • fitDataFrame<T, K, R>(features: DataFrame<{ [ P in string]: T }>, target: null | R, convertDType?: boolean): FittedUMAP
  • Fit features into an embedded space

    Type parameters

    Parameters

    • features: DataFrame<{ [ P in string]: T }>

      Dense or sparse matrix containing floats or doubles. Acceptable dense formats: cuDF DataFrame

    • target: null | R

      cuDF Series containing target values

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns FittedUMAP

    FittedUMAP object with updated embeddings

fitSeries

  • fitSeries<T, R>(features: T, target: null | R, nFeatures?: number, convertDType?: boolean): FittedUMAP
  • Fit features into an embedded space

    Type parameters

    Parameters

    • features: T

      cuDF Series containing floats or doubles in the format [x1, y1, z1, x2, y2, z2...] for features x, y & z.

    • target: null | R

      cuDF Series containing target values

    • nFeatures: number = 1

      number of properties in the input features, if features is of the format [x1,y1,x2,y2...]

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns FittedUMAP

    FittedUMAP object with updated embeddings

getEmbeddings

  • getEmbeddings<T>(dtype: T): Embeddings<T>
  • Type parameters

    Parameters

    • dtype: T

      Numeric cudf DataType

    Returns Embeddings<T>

    Embeddings in low-dimensional space in dtype format, which can be converted to any of the following types: DataFrame, Series, DeviceBuffer.

    getEmbeddings(new Float64).asDataFrame(); // returns DataFrame<{number: Series<Numeric>}>
    getEmbeddings(new Int32).asSeries(); // returns Series<Numeric>
    getEmbeddings(new UInt32).asDeviceBuffer(); //returns rmm.DeviceBuffer

getUMAPParams

  • getUMAPParams(): UMAPParams

refineArray

  • refineArray<T>(features: (undefined | null | number | bigint)[], target: null | (undefined | null | number | bigint)[], nFeatures?: number, convertDType?: boolean): void
  • Refine features into existing embedded space as base

    Type parameters

    Parameters

    • features: (undefined | null | number | bigint)[]

      array containing floats or doubles in the format [x1, y1, z1, x2, y2, z2...] for features x, y & z.

      // For a sample dataset of colors, with properties r,g and b:
      features = [
      ...Object.values({ r: xx1, g: xx2, b: xx3 }),
      ...Object.values({ r: xx4, g: xx5, b: xx6 }),
      ] // [xx1, xx2, xx3, xx4, xx5, xx6]
    • target: null | (undefined | null | number | bigint)[]

      array containing target values

      // For a sample dataset of colors, with properties r,g and b:
      target = [color1, color2] // len(target) = nFeatures
    • nFeatures: number = 1

      number of properties in the input features, if features is of the format [x1, y1, x2, y2...]

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns void

refineDataFrame

  • refineDataFrame<T, K, R>(features: DataFrame<{ [ P in string]: T }>, target: null | R, convertDType?: boolean): void
  • Refine features into existing embedded space as base

    Type parameters

    Parameters

    • features: DataFrame<{ [ P in string]: T }>

      Dense or sparse matrix containing floats or doubles. Acceptable dense formats: cuDF DataFrame

    • target: null | R

      cuDF Series containing target values

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns void

refineSeries

  • refineSeries<T, R>(features: T, target: null | R, nFeatures?: number, convertDType?: boolean): void
  • Refine features into existing embedded space as base

    Type parameters

    Parameters

    • features: T

      cuDF Series containing floats or doubles in the format [x1, y1, z1, x2, y2, z2...] for features x, y & z.

    • target: null | R

      cuDF Series containing target values

    • nFeatures: number = 1

      number of properties in the input features, if features is of the format [x1,y1,x2,y2...]

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns void

setUMAPParams

  • setUMAPParams(input: UMAPParams): void

transformArray

  • Transform features into the existing embedded space and return that transformed output.

    Type parameters

    Parameters

    • features: (undefined | null | number | bigint)[]
    • nFeatures: number = 1

      number of properties in the input features, if features is of the format [x1,y1,x2,y2...]

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns Embeddings<Int8 | Int16 | Int32 | Uint8 | Uint16 | Uint32 | Int64 | Uint64 | Float32>

    Transformed features into the existing embedded space and return an Embeddings instance which can be converted to any of the following types: DataFrame, Series, DeviceBuffer.

    transformArray(...).asDataFrame(); // returns DataFrame<{number: Series<Numeric>}>
    transformArray(...).asSeries(); // returns Series<Numeric>
    transformArray(...).asDeviceBuffer(); //returns rmm.DeviceBuffer

transformDataFrame

  • Transform features into the existing embedded space and return that transformed output.

    Type parameters

    Parameters

    • features: DataFrame<{ [ P in string]: T }>
    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns Embeddings<Int8 | Int16 | Int32 | Uint8 | Uint16 | Uint32 | Int64 | Uint64 | Float32>

    Transformed features into the existing embedded space and return an Embeddings instance which can be converted to any of the following types: DataFrame, Series, DeviceBuffer

    transformDataFrame(...).asDataFrame(); // returns DataFrame<{number: Series<Numeric>}>
    transformDataFrame(...).asSeries(); // returns Series<Numeric>
    transformDataFrame(...).asDeviceBuffer(); //returns rmm.DeviceBuffer

transformSeries

  • Transform features into the existing embedded space and return that transformed output.

    Type parameters

    Parameters

    • features: T
    • nFeatures: number = 1

      number of properties in the input features, if features is of the format [x1,y1,x2,y2...]

    • convertDType: boolean = true

      When set to True, the method will automatically convert the inputs to float32

    Returns Embeddings<Int8 | Int16 | Int32 | Uint8 | Uint16 | Uint32 | Int64 | Uint64 | Float32>

    Transformed features into the existing embedded space and return an Embeddings instancewhich can be converted to any of the following types: DataFrame, Series, DeviceBuffer.

    transformSeries(...).asDataFrame(); // returns DataFrame<{number: Series<Numeric>}>
    transformSeries(...).asSeries(); // returns Series<Numeric>
    transformSeries(...).asDeviceBuffer(); //returns rmm.DeviceBuffer