Skip to content

Instantly share code, notes, and snippets.

@MaxGSEO
Created October 23, 2023 00:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save MaxGSEO/4abfd0c257897528b3279636acfc3a5e to your computer and use it in GitHub Desktop.
Save MaxGSEO/4abfd0c257897528b3279636acfc3a5e to your computer and use it in GitHub Desktop.
Testing Scoring System
from collections import Counter
import pandas as pd
# Define scoring variables
core_set_score = 5
second_tier_score = 3
third_tier_score = 1
grace_zone_boost = 1
entity_boost = 1
double_entity_boost = 2
tag_title_meta_score = 20
images_score = 5
completeness_bonus = 5
diversification_bonus = 5
max_string_score = 100 - tag_title_meta_score - images_score - completeness_bonus - diversification_bonus
# Simulate scenarios
def simulate_scenarios():
scenarios = []
for core_set_count in range(1, 11):
for second_tier_count in range(1, 16):
for third_tier_count in range(1, 21):
score_from_strings = (core_set_count * core_set_score +
second_tier_count * second_tier_score +
third_tier_count * third_tier_score)
diversification_penalty = 0
if score_from_strings > max_string_score:
diversification_penalty = score_from_strings - max_string_score
score_from_strings = max_string_score
final_score = (score_from_strings + tag_title_meta_score +
images_score - diversification_penalty)
is_complete = (core_set_count >= 5 and
second_tier_count >= 10 and
third_tier_count >= 15)
is_diverse = (core_set_count + second_tier_count + third_tier_count) >= 30
if is_complete:
final_score += completeness_bonus
if is_diverse:
final_score += diversification_bonus
scenarios.append({
'Core Set Count': core_set_count,
'Second Tier Count': second_tier_count,
'Third Tier Count': third_tier_count,
'Score from Strings': score_from_strings,
'Diversification Penalty': diversification_penalty,
'Final Score': final_score,
'Is Complete': is_complete,
'Is Diverse': is_diverse
})
return pd.DataFrame(scenarios)
# Run the simulation and filter results
scenarios_df = simulate_scenarios()
filtered_scenarios = scenarios_df[(scenarios_df['Final Score'] >= 90) & (scenarios_df['Final Score'] <= 100)]
@MaxGSEO
Copy link
Author

MaxGSEO commented Oct 23, 2023

The simulation evaluated a total of 3000 scenarios, considering various combinations of the usage of strings from the core set, second tier, and third tier. The code looped through each possible combination within reasonable limits to calculate the final score based on the rules we brainstormed.

@MaxGSEO
Copy link
Author

MaxGSEO commented Oct 23, 2023

Strings range is not taken into consideration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment