Skip to content

Analyze Soccer Data, a java program I made my first semester at College

Notifications You must be signed in to change notification settings

Marc-9/SoccerStats

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

31 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SoccerStats Info


Update as of 02/14/19

Code is going to look a lot different as I loaded in a new dataset and I now have a infinite loop menu to allow user to keep running stats without having to reload the data, I may still add to this repo later but Im trying to recreate this in Pyton



Soccer Stats is a Java Based program that allows the user to calculate any type of stats/data that they wish.

Users may download their own data of any type and load it into the program and run a couple of pre-defined functions on them or make their own.

Soccer Stats is still in its beginning so few commands exists and there is no GUI yet, additionally while Java is not the best language for data analytics it is very beginner friendly.

Files and Functions

Currently the program only contains two files, but they can be used for multiple different leagues

Games.java

The Games.java file has a Constructor Games that can take in different types of data, you can change this to fit whatever stats you have.

I overwrote the tostring method to print out the result of a game, this is only because my data was formatted to show individual games in the season, this can be changed once again to fit your data needs

InInterval and create date are to be finished methods, where I hope to be able to show games from a certain date range. This has multiple uses including building tables from past weeks, or viewing how a team does over winter.

Season.java

The second file is Season.java that creates and ArrayList of Games from the Games.java file

I then created a addGame and readGame function which can be applied to user defined inputs

Proccessline was made just for reading sake as is a part of ReadGame

To string is another again just made for the data I input, and it calls the toString method made in Games.java

Lastly findGames.java is a work in process as would call and find games from the inInterval function

Commands

The only commands that NEED to be run are the commands to initlaize the data, the analytics commands are optional and are just there to help facilitate you in writing whatever commands you want. Now that you understand each file and their function lets learn how to implement these to run analytics on your data, this code goes into the Main Body of Season.java

Initalize Data

  1. Season SEASON_NAME = new Season();
    • Creates an instance of Season, to run commands in Season with
  2. SEASON_NAME.readGames(“[File Name]“);
    • Reads the stats from the file into the provided data constructors, the Stats have now been initialized and you can use the methods provided to run analysis or create your own. Below are some examples

Run Analytics

  1. ArrayList teams = SEASON_NAME.listTeams()
    • Creates an ArrayList of Teams form the data,If you wanted just teams from a certain division write an additional method that reads the Division variable
  2. Teams TEAM_NAME= new Teams(“TEAM_NAME”, SEASON_NAME);
    • Gets all games from provided Team Name
  3. SEASON_NAME.head2Head(“TEAM_NAME_1”, “TEAM_NAME_2”));
    • Prints the head to head record between the two provided teams
  4. SEASON_NAME.Season.*
    • Same concept applies to getting data from entire Team file, TEAM_NAME.Games.*
  5. SEASON_NAME.Season.size()
    • Gets number of games played
  6. int goals = 0;
    for (int i = 0; i < SEASON_NAME.Season.size(); i ) {
    goals = SEASON_NAME.Season.get(i).totGoals;}
    • Gets the total number of goals scored in the data set, *NOTE* Tot goals is not apart of the provided data but a data point I made by adding away goals and home goals from each game provided to speed up the loop

To do

  1. Finish InInterval... and other functions relating to dates
  2. Add functions to automaticaly grab goals scored and other stats.
  3. Add more stats and leagues
  4. Make my own compare to function
  5. Add stats for players
  6. GUI

About

Analyze Soccer Data, a java program I made my first semester at College

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages