Git Product home page Git Product logo

Comments (4)

Wwwwei avatar Wwwwei commented on May 30, 2024 1

Thanks a lot. I got it.

from ranx.

AmenRa avatar AmenRa commented on May 30, 2024

Hi, you can find an example on Colab and other information here.

As for your example, you could to something like this:

from ranx import Run, fuse

run_1 = Run({"q1": {"item1": 0.4, "item2": 0.8, "item3": 0.7, "item4": 0.5}})
run_2 = Run({"q1": {"item1": 0.8, "item2": 0.7, "item3": 0.7, "item4": 0.6}})
run_3 = Run({"q1": {"item1": 0.2, "item2": 0.7, "item3": 1.0, "item4": 0.7}})

combined_run = fuse(runs=[run_1, run_2, run_3], method="max")

print(combined_run.to_dict()["q1"])

Output:

{
    "item2": 1.0,
    "item3": 1.0,
    "item1": 1.0,
    "item4": 0.625,
}

EDIT: copy-pasted wrong output dict.

from ranx.

Wwwwei avatar Wwwwei commented on May 30, 2024

Thank you for your reply! it is very helpful and I will try it soon.
By the way, any suggestions for speeding up when the number of items and the subranks (e.g., tens of thousands of items and dozens of subranks) are both large?

from ranx.

AmenRa avatar AmenRa commented on May 30, 2024

Neither the implemented methods nor the implementation itself are meant to be used in the context you describe.
Usually, we aggregate two or three rankings for 1k documents each (the top 1k in each ranking).
Give ranx a try for your use case. Maybe use it to find the method that works best with a sample of your data and then build your custom implementation that can run on the GPU.
I do not think you can do much better than my implementation performance-wise, at least not in Python.

from ranx.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.