ForzaJuve1 commited on
Commit
3060f0d
1 Parent(s): 90b4847

Update Integration

Browse files
Files changed (1) hide show
  1. Integration +37 -19
Integration CHANGED
@@ -4,7 +4,7 @@ import pandas as pd
4
  class Euro2020Dataset(DatasetBuilder):
5
  VERSION = "1.0.0"
6
 
7
- #def _info(self):
8
  return DatasetInfo(
9
  description="Your dataset description here.",
10
  features=Features({
@@ -109,28 +109,46 @@ class Euro2020Dataset(DatasetBuilder):
109
  # Since the final processed dataset is a single CSV file that combines the content from numerous rows to only 51 rows,
110
  # with each row representing the information of each game, I will just use a single 'train' split and no need for test / validation.
111
 
112
- filepath = "/Users/chuhanguo/Desktop/Winter 2024/STA 663/Euro2020.csv"
113
 
114
  return [
115
  SplitGenerator(
116
  name="train",
117
- gen_kwargs={"filepath": filepath}
118
  ),
119
  ]
120
 
121
- #def _generate_examples(self, filepath):
122
- #Here we read the CSV file and yield examples
123
- #data = pd.read_csv(filepath)
124
- #for idx, row in data.iterrows():
125
- #yield idx, {
126
- #"PlayerID": row["PlayerID"],
127
- #"PlayerName": row["PlayerName"],
128
- #"PlayerSurname": row["PlayerSurname"],
129
- #"IsGoalkeeper": row["IsGoalkeeper"],
130
- #"PlayedTime": row["PlayedTime"],
131
- #"StatsID": row["StatsID"],
132
- #"StatsName": row["StatsName"],
133
- #"Value": row["Value"],
134
- #"Rank": row["Rank"],
135
- # Make sure to include all fields defined in _info
136
- #}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  class Euro2020Dataset(DatasetBuilder):
5
  VERSION = "1.0.0"
6
 
7
+ def _info(self):
8
  return DatasetInfo(
9
  description="Your dataset description here.",
10
  features=Features({
 
109
  # Since the final processed dataset is a single CSV file that combines the content from numerous rows to only 51 rows,
110
  # with each row representing the information of each game, I will just use a single 'train' split and no need for test / validation.
111
 
112
+ path = "/Users/chuhanguo/Desktop/Winter 2024/STA 663/Euro2020.csv"
113
 
114
  return [
115
  SplitGenerator(
116
  name="train",
117
+ gen_kwargs={"filepath": path}
118
  ),
119
  ]
120
 
121
+ def _generate_examples(self, path):
122
+ data = pd.read_csv(path)
123
+ for idx, row in data.iterrows():
124
+ yield idx, {
125
+ "HomeTeamName": row["HomeTeamName"],
126
+ "AwayTeamName": row["AwayTeamName"],
127
+ "DateandTimeCET": row["DateandTimeCET"],
128
+ "MatchID": row["MatchID"],
129
+ "RoundName": row["RoundName"],
130
+ "Stage": row["Stage"],
131
+ "MatchDay": row["MatchDay"],
132
+ "Session": row["Session"],
133
+ "MatchMinute": row["MatchMinute"],
134
+ "InjuryTime": row["InjuryTime"],
135
+ "NumberofPhases": row["NumberofPhases"],
136
+ "Phase": row["Phase"],
137
+ "ScoreHome": row["ScoreHome"],
138
+ "ScoreAway": row["ScoreAway"],
139
+ "MatchStatus": row["MatchStatus"],
140
+ "StadiumID": row["StadiumID"],
141
+ "NumberofMatchesRefereedPostMatch": row["NumberofMatchesRefereedPostMatch"],
142
+ "TotalNumberofMatchesRefereed": row["TotalNumberofMatchesRefereed"],
143
+ "NumberofMatchesRefereedinGroupStage": row["NumberofMatchesRefereedinGroupStage"],
144
+ "NumberofMatchesRefereedinKnockoutStage": row["NumberofMatchesRefereedinKnockoutStage"],
145
+ "AssistantRefereeWebName": row["AssistantRefereeWebName"],
146
+ "Humidity": row["Humidity"],
147
+ "Temperature": row["Temperature"],
148
+ "WindSpeed": row["WindSpeed"],
149
+ "MatchEvent": row["MatchEvent"],
150
+ "TeamLineUps": row["TeamLineUps"],
151
+ "TeamStats": row["TeamStats"],
152
+ "PlayerStats": row["PlayerStats"],
153
+ "PlayerPreMatchInfo": row["PlayerPreMatchInfo"],
154
+ }