Skip to content

Commit

Permalink
prototype section completed
Browse files Browse the repository at this point in the history
  • Loading branch information
wolff01 committed May 3, 2024
1 parent 2604ad2 commit 278324d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 1 addition & 3 deletions project_proposal.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,7 @@ TODO (10 source minimum, with 5 of those being published peer-reviewed articles)

## Prototype

TODO: Discuss the methods of the project to be able to answer the `how` question (`how was this project completed?`). For this section, you must describe the methodology behind your implemented prototype. The methods section in an academic research outlines the specific procedures, techniques, and methodologies employed to conduct the study, offering a transparent and replicable framework for the research. It details the resources behind the work, in terms of, for example, the design of the algorithm and the experiment(s), data collection methods, applied software libraries, required tools, the types of statistical analyses and models which are applied to ensure the rigor and validity of the study. This section provides clarity for other researchers to understand and potentially replicate the study, contributing to the overall reliability and credibility of the research findings.

When thinking about this project and how to go about creating this. First laying out a plan that was going to keep a clear mind set if the goal ahead. The first part of the plan was to make a mathematical equation that can give the correct output and be realistic. The first issue was here as rhere are so many statistics that exist that could be use but are not the mose useful in this case. After trial and error and understanding each statistical measurement for where the statistics that were being used to contribute to this was found and how they were measured, the most efficient to be used in this case, and make the most impact kn this were sweet spot percentage and hard hit percentage.
When thinking about this project and how to go about creating this. First laying out a plan that was going to keep a clear mind set if the goal ahead. The first part of the plan was to make a mathematical equation that can give the correct output and be realistic. The first issue was here as there are so many statistics that exist that could be us but are not the most useful in this case. After trial and error and understanding each statistical measurement for where the statistics that were being used to contribute to this was found and how they were measured, the most efficient to be used in this case, and make the most impact on this were sweet spot percentage and hard hit percentage. Hard hit percentage is calculated as the percent of baseballs that were hit with an exit velocity of 95 miles an hour or harder off the bat. Sweet spot percentage is measured as baseballs that were hit off the bat at any angle between 8 degrees and 32 degrees. When taking a look at a hitter’s hard hit percentage, multiplying that number with the amount of balls hit in play, you get the total number of hard hit balls that a player had that were put in play. Then taking the total amount of swings a player takes in the strike zone and out of the strike zone. We then take that number and divide the amount of hard hit balls in play by total number of swings, we get the percentage of hard hit balls in play per total swings. Then doing that same process but using sweet spot percentage instead of hard hit percentage, we get the percentage of sweet spot hit balls in play per total swings. Taking those two percentages and multiplying the values together we are able to get the percentage of efficient swings a hitter has in a total season. Each part of the equation is clearly labeled when looking in the main.py file and they are all put into a streamlit table and you are given the option to sort the table by either the name of the player in descending order or by swing efficiency percentage in descending order as well. In the main we can see that the creation of each part is split up individually. This also is explained in each comment and docstring written that details every for loop, if statement, and function’s purpose.

## Preliminary Results and Outcomes

Expand Down
5 changes: 4 additions & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,12 @@ def divide_csv_part(filename, start_row, end_row, start_col, end_col):
else:
division_results_1.append(float('NaN'))

column_names = [((res_1 * res_2)* 100)for res_1, res_2 in zip(division_results_1, division_results_2)]


st.title("Swing Efficiency %")

a = {'Names': print_csv_row_range(filename, 1, 135),'Swing Efficiency %': division_results_1}
a = {'Names': print_csv_row_range(filename, 1, 135),'Swing Efficiency %': column_names}
df = pd.DataFrame.from_dict(a, orient='index')
df = df.transpose()

Expand Down

0 comments on commit 278324d

Please sign in to comment.