{"id":13524931,"url":"https://github.com/OutRankNFT/OutRank-Rarity","last_synced_at":"2025-04-01T04:30:25.706Z","repository":{"id":196549814,"uuid":"695165971","full_name":"OutRankNFT/OutRank-Rarity","owner":"OutRankNFT","description":null,"archived":false,"fork":false,"pushed_at":"2023-11-01T08:10:14.000Z","size":236,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-02T09:32:11.626Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Jupyter Notebook","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/OutRankNFT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2023-09-22T13:53:37.000Z","updated_at":"2024-02-29T15:24:48.000Z","dependencies_parsed_at":"2024-01-16T14:06:27.986Z","dependency_job_id":"1d1d2885-2075-49b3-984b-eeab7017019c","html_url":"https://github.com/OutRankNFT/OutRank-Rarity","commit_stats":null,"previous_names":["outranknft/outrank-rarity"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutRankNFT%2FOutRank-Rarity","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutRankNFT%2FOutRank-Rarity/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutRankNFT%2FOutRank-Rarity/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/OutRankNFT%2FOutRank-Rarity/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/OutRankNFT","download_url":"https://codeload.github.com/OutRankNFT/OutRank-Rarity/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246585510,"owners_count":20801022,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T06:01:14.694Z","updated_at":"2025-04-01T04:30:25.451Z","avatar_url":"https://github.com/OutRankNFT.png","language":"Jupyter Notebook","funding_links":[],"categories":["Fungible and Non-fungible Tokens (NFTs)"],"sub_categories":["Analytical Methodologies"],"readme":"# OutRank-Rarity\nWe've implemented mathematical code to calculate rarity of NFT collections in both of Python and Rust\n- Rarity_math_code_python.ipynb is for Python code and \n- Rarity_math_code_rust.rs is for Rust code.\n- Script_for_fetch_data_from_canister.rs is for Rust code to fetch NFT collections trait data(we'll call this \"canister data\") by inter-canister call.\nHere is a breif explanation for rarity_math_code_rust.rs.\n\n## Basic Usage for Rust code\n- Fetch canister data(nft collections trait data) as an Object array.\n  - (trait_object_array, trait_array) = fetch_canister_data(canister_id);\n    - trait_object_array example : [{\"skin (texture)\": \"Dark\", \"Gender\": \"Male\", \"Move\": \"Breakdance Uprock\", \"Background\": \"Blue\", \"Cloths\": \"Casual Shirt/Pants\"}, ... ... ...]\n  - trait_array  is array of collections trait properties.\n    - trait_array example : [\"Move\", \"skin (texture)\", \"Background\", \"Cloths\", \"Gender\", \"Asssecrioes\"]\n      \n- Calculate traits_value from canister_data. Canister_data is an Object Array and convert it as Two-Dimensional Array. Row Index is NFT id. Column Index is same as trait_array.\n  - traits_value = canister_data_to_traits_value(trait_object_array,trait_array);\n    - traits_value example : [ [ \"Breakdance Uprock\", \"Dark\", \"Blue\", \"Casual Shirt/ Pants\", \"Male\", \"NA\" ], [ \"Salsa (long)\", \"Light\", \"Yellow\", \"Jump Suit\", \"Male\", \"NA\" ], ... ... ...]\n    \n- Calculate traits_count and traits_freq from reversed traits_value. Reversed traits_value is also Two-Dimensional array. But Row Index is same as trait_array and Column Index is same as NFT id. traits_count represent count of same value in row(Each row is trait property) and traits_freq is same as NFTs count devided traits_count.\n  - (traits_count, traits_freq) = get_traits_count_freq_number(reverse_mat(traits_value));\n    - traits_count example : [ [2 ,2 ,1, 8, 8, 8, 2, 6, ...], [8, 12, 12, 12, 12, 12, 8, ...], ... ... ]\n    - traits_freq example : [ [0.0391, 0.03921, 0.01961, 0.15686, 0.15686, 0.15686, ... ], ... ]\n- calculate rarity_mat from traits_freq. rarity_mat has 5 rows.\n  - First row is array of min value of column.\n  - Second row is array of max value of column.\n  - Third row is array of arithmetic value of column.\n  - Fourth row is array of harmonic value of column.\n  - Fifth row is array of geometric value of column.\n  - rarity_mat = rare_calc(traits_freq);\n    \n- Calculate rarity_score from rarity_mat. rarity_score is Two-Dementional array that contains normalized value between 0 and 1 of rarity_mat.\n  - rarity_score = score_calc(rarity_mat);\n    \n- Calculate rarity_rank from rarity_score. rarity_rank is Two-Dementional array contains rows sorted by value from rarity_score.\n  - rarity_rank = rare_rank(rarity_score);\n    \n- These two methods calculate trait_independence and trait_cramers_v from traits_freq. By calcuating Chi-Two-squared distribution.\n  - trait_independence = trait_independence(traits_freq);\n  - trait_cramers_v = trait_cramers_v(traits_freq);\n    \n- Calculate trait_normalize from traits_value, traits_count, traits_freq.Trait_normalize means trait normalised rarity score\n  - trait_normalize = trait_normalize(reverse_mat(traits_value), traits_count, traits_freq);\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOutRankNFT%2FOutRank-Rarity","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FOutRankNFT%2FOutRank-Rarity","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FOutRankNFT%2FOutRank-Rarity/lists"}