Skip to main content

osu!mania score prediction through AI collaborative filtering

Project description

:arrow_forward: Try Out Opal on Streamlit

modelsize version pyversions https://img.shields.io/pypi/dm/opal-net

Test Model Pipeline Inference

:comet: opal-net

opal is an accuracy-prediction model.

It uses a Matrix Factorization branch & Multi-layered Perceptron branch to learn associations between user and maps, then use those associations to predict new scores never before seen.

:hourglass_flowing_sand: Project Status

Currently, it's in its early access, that means, it'll have many problems! However, we're working on it to minimize these issues o wo)b

:arrow_double_down: Dataset Used

I used the top 10K mania users data from https://data.ppy.sh. After preprocessing, we use

  • ~10m scores for training
  • ~1m scores for validation and testing each

After preprocessing, we found ~30K valid users, ~10K valid maps This models can thus help predict ~300m unplayed scores!

Users

We deem a player on separate years as a different user. This is to reflect the improvement of the player after time.

:high_brightness: Usage

To use this, install opal-net

pip install opal-net

Then in a python script

Tip: GPU doesn't speed this up significantly, you can use a CPU.

from opal import OpalNet

# Load in the model
# You can explicitly specify map_location='cpu' or 'cuda' in map_location=...
opal = OpalNet.load()

# You can predict a single instance.
#
# The 1st arg: "<USER_ID>/<YEAR>",
# The 2nd arg: "<MAP_ID>/<SPEED>" 
#   <YEAR> is the year of the user to test.
#   <SPEED> can be {-1, 0, or 1} for {HT, NT, DT}
#
# For example: 
# Predict Evening on Year 2020, on the map Triumph & Regret [Regret] at Double Time
pred = opal.predict("2193881/2020", "767046/1")

# You can predict multiple entries at the same time. This is much faster that looping the above.
# Note that both lists must be of the same length!
# Note: If you're predicting millions, partition the predictions to reduce GPU memory usage!
preds = opal.predict(["2193881/2020", "2193881/2017"], ["767046/0", "767046/1"])

# Note that if the prediction doesn't exist, then it'll raise a ValueError
try:
    opal.predict("2193881/2018", "767046/0")
except ValueError:
    print("Prediction Failed!")

:brain: AlphaOsu!

Currently, opal doesn't provide recommendations, however, you can try out AlphaOsu!.

Annex

Why not Score Metric?

Score is not straightforward to calculate, and may be difficult to debug. Furthermore, score isn't of interest when calculating performance points anymore.

osu!mania ScoreV1 Reference

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

opal_net-2023.9.5b0.tar.gz (7.5 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

opal_net-2023.9.5b0-py3-none-any.whl (7.5 MB view details)

Uploaded Python 3

File details

Details for the file opal_net-2023.9.5b0.tar.gz.

File metadata

  • Download URL: opal_net-2023.9.5b0.tar.gz
  • Upload date:
  • Size: 7.5 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.13 Windows/10

File hashes

Hashes for opal_net-2023.9.5b0.tar.gz
Algorithm Hash digest
SHA256 ac50eb09820ae433a850c670a29d6ab5e060c151be77c4571a88ae256cf51181
MD5 31c11b9c73ecc1b9f200c9f43926e736
BLAKE2b-256 3329876d40025507670afff4603afbbd7bb854097ed50a63d6acbebf2a0ca150

See more details on using hashes here.

File details

Details for the file opal_net-2023.9.5b0-py3-none-any.whl.

File metadata

  • Download URL: opal_net-2023.9.5b0-py3-none-any.whl
  • Upload date:
  • Size: 7.5 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.3.2 CPython/3.9.13 Windows/10

File hashes

Hashes for opal_net-2023.9.5b0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bfb6c0e05ef860ec96a5120ebb8fc1a0b8f6bd2bd730fa97e633d66240c3dd1
MD5 2bd0c40b3e889a9c0d16eab293f866da
BLAKE2b-256 94a08f9f181cb15a57978499c214f1a01f68c23e02cd7ae8248f06993071129b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page