RandomBinaryProjectionSearcher constructor

RandomBinaryProjectionSearcher(
  1. DataFrame data,
  2. int digitCapacity, {
  3. int? seed,
  4. DType dtype = DType.float32,
})

Takes data, trains the model on it and returns RandomBinaryProjectionSearcher instance.

Training means distributing all points from the reference data by bins. A bin is identified by an integer index that is generated as a binary number.

Parameters:

digitCapacity A number of bits of a bin index. Examples:

  • digitCapacity equals 2, possible binary bin indices: 01, 00, 11, 10

  • digitCapacity equals 3, possible binary bin indices: 000, 001, 010, ...

  • digitCapacity equals 4, possible binary bin indices: 0000, 0001, 0010, ...

seed A seed value for the random generator which will be used to get bin indices

dtype A data type for matrix representation of the data

Example:

import 'package:ml_algo/ml_algo.dart';
import 'package:ml_dataframe/ml_dataframe.dart';

void main() {
  final data = DataFrame([
    ['feature_1', 'feature_2', 'feature_3']
    [10, 20, 30],
    [11, 19, 31],
    [19, 43, 20],
    [89, 97, 11],
    [12, 32, 10],
  ]);
  final digitCapacity = 3;

  final searcher = RandomBinaryProjectionSearcher(data, digitCapacity, seed: 4);
}

Implementation

factory RandomBinaryProjectionSearcher(DataFrame data, int digitCapacity,
        {int? seed, DType dtype = DType.float32}) =>
    createRandomBinaryProjectionSearcher(data, digitCapacity,
        seed: seed, dtype: dtype);