class_docstr: Use a binary index backed by a float index
class_docstr_tok: ["Use","a","binary","index","backed","by","a","float","index"]
code: def test_wrapped_quantizer_IMI(self):
      d = 256
      nt = 3500
      nb = 10000
      nq = 500
      (xt, xb, xq) = make_binary_dataset(d, nb, nt, nq)
  
      index_ref = faiss.IndexBinaryFlat(d)
  
      index_ref.add(xb)
  
      nlist_exp = 6
      nlist = 2 ** (2 * nlist_exp)
      float_quantizer = faiss.MultiIndexQuantizer(d, 2, nlist_exp)
      wrapped_quantizer = faiss.IndexBinaryFromFloat(float_quantizer)
      wrapped_quantizer.train(xt)
  
      assert nlist == float_quantizer.ntotal
  
      index = faiss.IndexBinaryIVF(
          wrapped_quantizer, d, float_quantizer.ntotal
      )
      index.nprobe = 2048
      assert index.is_trained
  
      index.add(xb)
  
      D_ref, I_ref = index_ref.search(xq, 10)
      D, I = index.search(xq, 10)
  
      recall = sum(
          gti[0] in Di[:10] for gti, Di in zip(D_ref, D)
      ) / float(D_ref.shape[0])
  
      assert recall > 0.82, "recall = %g" % recall
  
file_path: faiss/tests/test_index_binary_from_float.py
imports: from __future__ import absolute_import, division, print_function
  import numpy
  import unittest
  import faiss
label_desc: Use image node_id 3 for calling the TestIndexBinaryFromFloat obj's underlying member method code with example usage: obj.test_wrapped_quantizer_IMI() without return types