<jupyter_start><jupyter_text>Data Analysis on the Results of the Hip Hop International 2019*Developer:* <NAME>This Data science project seeks to analyze the score cards of teams within dance competition Hip Hop International 2019. It seeks to analyze the results of each team in various stages of the competition. The project also serves as a exploratory analysis on insights that can be gathered based on the dataset extracted from the results of the competition. Moreover, the study also hopes to find insights with regards to how judging is conducted throughout the competition. ReferencesHip Hop international. (n.d.). World hip hop dance championship. Hip Hop International. https://www.hiphopinternational.com/world-hip-hop-dance-championship/ Database Resource1. *Hip Hop International (Results) -* http://www.hiphopinternational.com/medalists/---- What is Hip Hop International?Hip Hop International (HHI) is one of the world's largest dance competitions. The event hosts over four thousand dancers from all over the world to compete with one another to receive the competition's world title.(Hip Hop International, n.d.) It is often regarded as the world's olympic for streetdance as dance teams from all around the world gather and compete for this event annually. Competition DivisionsThe competition currently has 5 divisions. The divisions are Junior Division, Varsity Division, Adult Division, MiniCrew Division, and MegaCrew Division. With teams competiting from various parts of the world.| Division |  of Members | Age Group||:-----------:|:-----------:|:-----------:|| **Junior Division** | 5-9 | 7-12 |  | **Varsity Division** | 5-9 | 13-18 |  | **Adult Division** | 5-9 | 18+ |  | **MiniCrew Division** | 3 | No Restrictions || **MegaCrew Division** | 10-40 | No Restrictions | Competition FlowCompetiting teams in HHI go through 3 different stages of competition the Prelims, SemiFinals, Finals. At each stage, the total number of competiting teams are eliminated from the competition based on their ranking until the finals where a podium of 3 winners are determined (Champion, 1st Runner-Up, 2nd Runner-Up).   Data AnalysisThis section aims to analyze the results of Hip Hop International 2019 through the results of the competition. The dataset was released in their website http://www.hiphopinternational.com/medalists/. However, the data provided by Hip Hop International was created as a PDF file for Prelims, SemiFinals, and Finals. I was forced to manually encode the data into a csv file for uniformity moving forward in the analysis.<jupyter_code># import packages
import pandas as pd
import numpy as np
from math import ceil<jupyter_output><empty_output><jupyter_text>Dataset DocumentationThis is the documentation of the dataset file hhi2019.csv that contains the dataset of the results for the Hip Hop International 2019.| Column Name | Data Type | Description ||:------------|:---------:|:-----------|| **Year** | Date | Date of the performance || **Category** | String | Category of Performance (Prelimnary, Semi-Finals, Finals) || **rank** | String | The rank of the Dance Team in their respective competition category || **Team** | String | The name of the Dance Team || **Division** | String | The Division of where the Team is competing in || **Country** | String | Origin Country of the Team || **Performance_1** | float64 | Score of Performance Judge 1 || **Performance_2** | float64 | Score of Performance Judge 2 || **Performance_3** | float64 | Score of Performance Judge 4 || **Performance_4** | float64 | Score of Performance Judge 4 || **Total_Performance** | float64 | Overall performance score|| **Skill_1** | float64 | Score of Skill Judge 1 || **Skill_2** | float64 | Score of Skill Judge 2 || **Skill_3** | float64 | Score of Skill Judge 3 || **Skill_4** | float64 | Score of Skill Judge 4 || **Total_Pkill** | float64 | Overall skill score|| **Deductions** | float64 | Deductions given to the team || **Overall** | float64 | Overall Score of the team |*Notes:*1. Currently the dataset only contains data for the MegaCrew Division.2. The dataset does not include overall score values as it will be computed based on the raw scores given by the HHI 2019 panel of judges. This is to get the full numeric total and not a rounded off value.<jupyter_code>hhi = pd.read_csv('./../datasets/hhi2019.csv')
hhi.head()
hhi.dtypes<jupyter_output><empty_output><jupyter_text>Judging CriteriaTeams were judged during HHi2019 through 2 criterias, Performance and Score. The following is the breakdown of the criterias:| Criteria | Breakdown | Weight (%) ||:------------|:---------|:-----------:|| **Performance** | Creativity | 10% ||| Staging, Spacing, Formations, and Level Changes | 10% ||          | Showmanship: Intensity, Confidence, Projection & Presence  | 10% ||          | Style Presence & Attire  | 10% ||          | Entertainment Value / Audience Appeal  | 10% || **Skill** | Musicality | 10% ||| Synchronization / Timing | 10% ||          | Execution/Controlled Mobility and Stabilization  | 10% ||          | Difficulty of Execution of Authentic Dance Styles | 10% ||          | Variety of Dance Styles  | 10% || **Total**  ||**100%** |The Judging Criteria can befound in the HHI Rules and Regulations (c) 2020*http://www.hiphopinternational.com/wp-content/uploads/2020/01/HHI-Rules-Regulations-Adjusted.pdf* Based on the criterias set by the Hip Hop International rules and regulations there are still a lot of areas where data can be explored in order to help continue and improve routines of different dance routines for competitive streetdance. However, access to such feedback is limited. The public data on the scores and results given by the organization is limited only to the overall score of the performance and skill criterias. Having breakdown scores for each category may be seen as a difficulty during competition day encoding. However, if such breakdowns are available for teams to review training adjustment based on such feedback data may allow areas of improvement for teams when the data is correctly interpreted for the benefit of each streetdance team.  Computing overall scoresThis section will compute the overall scores based on the raw scores of the teams. The formula to get the overall score is `total performance score + total skill score = overall score`To get both the total performance score and total skill score has to go through a scoring system where in the minimum and maximum scores of the<jupyter_code># An array of tuples containing scores given by judges in each criteria
# There are only 2 performance criterias Performance & Skill

performance = [list(scores) for scores in zip(hhi['performance_1'], hhi['performance_2'], hhi['performance_3'], hhi['performance_4'])]
skill = [list(scores) for scores in zip(hhi['skill_1'], hhi['skill_2'], hhi['skill_3'], hhi['skill_4'])]
def round_conditional(number):
    '''
    number: any number
    ---
    round up a number only if it has 3 or more decimals.
    '''
    num = str(number)
    deci = num.split('.')
    if len(deci[1]) >= 3:
        return math.ceil(number*100) / 100
    else:
        return number
def total_score(scores):
    '''
    Arguements:
    
    scores: an array of tuples containing the scores of all judges in a criteria for a team.
    ---------
    total_score calculates the score of a criteria based on HHIs grading computation for total performance score and total skill score.
    Both are calculated by dropping the highest score and lowest score and computing for the average of the remaining score values.
    '''
    scores = np.array(scores)
    criteria_scores = []
    for team in scores:
    # delete minimum and maximum scores to normalize scores for computation
        official_score = np.delete(team, [np.argmin(team), np.argmax(team)])
        criteria_score = official_score.sum() / len(official_score)
        criteria_scores.append(round_conditional(criteria_score))
    #return np.array(scores)
    return criteria_scores
# Encode the total performance and skill scores for each team
hhi['total_performance'] = total_score(performance)
hhi['total_skill'] = total_score(skill)

# Computer for overall score per team
hhi['overall'] = [performance + skill - deductions for performance, skill, deductions in zip(hhi['total_performance'], hhi['total_skill'], hhi['deductions'].fillna(0))]
# Complete Data Table of the results from HHI2019
hhi.head()<jupyter_output><empty_output><jupyter_text>Ranking of TeamsThis section will explore the rankings of each team per judge and per criteria. Exploring such information may provide some insight as to the extent to where their strengths and weaknesses as a team were evident based on each judges' judgement and each score.<jupyter_code>### Ranking of Teams based on Performance
# Set Parameters for which event

event = 1
# 1 = Preliminary
# 2 = Semi-Finals
# 3 = Finals
def event(event):
    if event == 1:
        return 'Preliminary'
    elif event == 2:
        return 'Semi-Finals'
    elif event == 3:
        return 'Finals'<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.09263945428539994, 'fraction_numerical': 0.018043789195731103, 'mean_word_length': 4.188356164383562, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 19, 'https://': 1, 'lorem ipsum': 0, 'www.': 4, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '4', 'dir': 'jupyter-structured-clean-dedup', 'id': '198546', 'license': 'MIT', 'n_tokens_mistral': 2480, 'n_tokens_neox': 2274, 'n_words': 1125, 'path': 'notebooks/hhi2019_notebook.ipynb', 'repo_name': 'enzorooo/hiphopinternational2019', 'size': '9114'}