---
# System prepended metadata

title: Feature Engineering for CoachAI

---

# Feature Engineering for CoachAI
### Possible methods
- Categorical data
- Handling outliers
    - removal
    - replacing values
    - capping
    - discretization
    - 
.....

### Create features:

陳沂亨
- distance: between opponent and player
- time_diff: time(i) - time(i-1)
- classification on x-axis distance and y-axis distance
- ~~polynomial features: Do polynomial to our input feature and test the performance.~~
- shot_angle: compute the distance and the locations of two players to get the angle
- x-axis, y-axis distance 
- ~~one hot encoding on shot types~~

Jean

- rank / frequency distribution of shot type of the player itself
- score_gap: roundscoreA - roundscoreB 
- win ratio
- landing position variation: Compute the variation (e.g., standard deviation) of landing positions within the previous shots of the same player or rally.
- Match progress: Encode the progress of the match (e.g., 25% complete, 50% complete) as a feature.


### Question:
1. How do we know the player is A or B from the player id???


# Meta
The plot of duration for each match.
![](https://hackmd.io/_uploads/HyzY7b-D3.png)
Average the duration by the number of sets.
![](https://hackmd.io/_uploads/HkUmVbWDn.png)

The average duration is `22.603448275862068`. (Already averaged by #sets)


# val_given
location_area: 有一個row的area為10，不合法

![](https://hackmd.io/_uploads/Bkk2Gn-Ph.png)
![](https://hackmd.io/_uploads/rkT5Aibvn.png)

### counts of location area pairs. Pairs that are not shown have value 0.
| pair  | value |
|-------|-------|
| (1, 7)  | 11    |
| (1, 8)  | 14    |
| (2, 7)  | 2     |
| (2, 8)  | 20    |
| (3, 8)  | 20    |
| (4, 8)  | 23    |
| (5, 8)  | 16    |
| (6, 8)  | 16    |
| (7, 7)  | 77    |
| (7, 8)  | 363   |
| (8, 4)  | 2     |
| (8, 5)  | 3     |
| (8, 6)  | 4     |
| (8, 7)  | 5     |
| (8, 8)  | 705   |
| (8, 9)  | 14    |
| (9, 8)  | 104   |

最常發生的是，兩個人都站在8號區域，也就是場地中央。

![](https://hackmd.io/_uploads/BJaKdaWvn.png)
![](https://hackmd.io/_uploads/r1hHjaWwn.png)


| graphs |  |
| -------- | -------- |
| ![](https://hackmd.io/_uploads/H1RTi6bP2.png) | ![](https://hackmd.io/_uploads/ry9gnT-w3.png)
| ![](https://hackmd.io/_uploads/Hkb73abvn.png) | ![](https://hackmd.io/_uploads/HJeHhaWP3.png) |
|![](https://hackmd.io/_uploads/S1bL2T-Ph.png)|![](https://hackmd.io/_uploads/SJ2InpWPn.png)|

## Time interval
![](https://hackmd.io/_uploads/B1ELIC-v3.png)
![](https://hackmd.io/_uploads/rkwKAEHv2.png)
 



______________________________________________________________
![](https://hackmd.io/_uploads/S1kKnFBPh.png)

![](https://hackmd.io/_uploads/HJ_Y2YHvn.png)

![](https://hackmd.io/_uploads/Bk-53tSPh.png)

![](https://hackmd.io/_uploads/ByvcnYBP3.png)

![](https://hackmd.io/_uploads/ryn53KBD2.png)

![](https://hackmd.io/_uploads/BkP87nrD3.png)
