Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Meta Trait: Trait Count #84

Merged
merged 12 commits into from
Oct 18, 2022
Merged

Adding Meta Trait: Trait Count #84

merged 12 commits into from
Oct 18, 2022

Conversation

vickygos
Copy link
Contributor

@vickygos vickygos commented Oct 14, 2022

Adding Trait Count to OpenRarity

We are automatically adding TraitCount as a meta trait upon Collection initialization so that the OpenRarity ranking and scoring algorithm takes into consideration trait count as an attribute to impact ranking for all collections. We will not modify open rarity scoring or ranking algorithm directly in any form.

For more detailed information and analysis, please review this blog post -https://mirror.xyz/openrarity.eth/oNo7AmgXopMCKq95gv_Xe0p5pKQ_qHWKzTV11DpFxgE

Definition of Trait Count

TraitCount is defined to be the sum of unique traits an asset has with a non-empty value

  • We consider empty to be where the normalized attribute value is any of (“”, “none”, None)

Methodology

Upon Collection initialization, we will modify the tokens input by adding in a new StringAttribute to the tokens' metadata with:

  • attribute.name = “meta_trait:trait_count”
    • Naming to decrease collision with existing trait
  • attribute.value = token.trait_count()
  • Note 1: We will not remove any existing fields, regardless if naming is similiar to “trait count”, “trait_count” etc. The reason is because probability and rankings will not be impacted.
  • Note 2: There’s a small chance we override attributes with “meta trait: trait_count” but don’t believe it’s likely enough to matter.

@vickygos vickygos changed the title Adding Meta Trait: Trait Count for Rarity Calculation Adding Meta Trait: Trait Count Oct 14, 2022
@amamujee
Copy link
Collaborator

amamujee commented Oct 14, 2022

I modified the PR text a bit.

@vickygos vickygos marked this pull request as ready for review October 15, 2022 02:22
Copy link
Collaborator

@theelderbeever theelderbeever left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That was a big one... A couple comments with possible additions and nits. Nothing major.

open_rarity/models/collection.py Outdated Show resolved Hide resolved
open_rarity/models/collection.py Outdated Show resolved Hide resolved
open_rarity/models/collection.py Show resolved Hide resolved
open_rarity/resolver/testset_resolver.py Show resolved Hide resolved
@vickygos vickygos merged commit 7556e35 into main Oct 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants