# A Machine Learning Approach to Determine Oyster Vessel Behavior
## 4 Materials and Methods
Figure 3: Two idealized vessel movement paths, linear (**A**) and circular (**B**). The top path (**A**) shows linear movement, where the last point in the path is far away from the origin. The bottom path (**B**) shows circular movement, where the first and last points are close to each other. Step 5. Calculating Net Speed of Vessel: Net speed at the points in a path are calculated only if the path contains at least 10 points. The paths containing less than 10 points are not considered a valid path and therefore are removed from further consideration. For paths containing more than 10 points, net speed is calculated using a sliding window of 10 points. The distance between the last and first points of the window over the difference in seconds between those two points is a single net speed value. Each point in the window has this net speed value appended to its list of net speeds and the window slides forward by one point. Since the window starts at the first point in the path and stops when the end of the window reaches the end point of the path, the start and the end points of the path will contain a single net speed value in its list of net speeds. Thus, the average of the list of net speeds for the start and end point of the path will be the same as the single net speed value. Step 6. Obtaining Ground Truth using Rule-Based Classifier: The rule-based classifier previously developed by [PERSON] [6] is used in this work to obtain the ground truth for each point. This rule-based classifier, deterministically groups the points into likeliest behavior using a set of rules, provided a point's speed and net speed are known. The set of rules used to determine the behavior from point's speed and net speed are as follows:  
1. If point's speed \(<\) 0.1 m/s and net speed \(<\) 0.1 m/s then the point is labelled as docked. 2. If point's speed \(<\) 0.5 m/s and net speed \(\leq\) (point's speed \(+\) 0.125 m/s) then the point is labelled as poling. 3. If point's speed \(\geq\) 0.5 m/s and \(\leq\) 1.75 m/s and net speed \(\leq\) (point's speed \(-\) 0.125 m/s) then the point is labelled as fishing. 4. If point's speed \(\geq\) 0.5 m/s and net speed \(\geq\) (point's speed \(+\) 0.125 m/s) or point's speed \(>\) 2 m/s and net speed \(\geq\) (point's speed \(-\) 2 m/s) then the point is labelled as traveling. 5. If rules from (i) through (iv) do not apply then the point is labelled as unknown. Step 7 and 7.1. Check Behavior at Each Point: From Step 6, we found that 48,645 points were labeled as \"unknown\" behavior. As these points could not be used for supervised machine learning, they were discarded from further consideration. Step 8. Designing ML-Based Classifiers: The points for which one of the four behaviors (docked, poling, fishing or traveling) could be determined using Step 6, were used as the validation/training/independent set were encoded using independent set. Each point in the validation/training/independent set were encoded using two important features--speed and net speed. Then, the two features along with the corresponding behavior type of all the points in the dataset were used as an input to the ML classifier to determine a vessel's movement pattern. _Data Conditioning_: In the case of ML classifiers, normalization of input data can reduce the time needed to train the classifier. This avoids crunching big-numbers and reduces the numerical dominance of one feature over another and thus improves prediction accuracy [15]. It is important to note that the scaling that is applied for training is the same scaling used at test time to predict the behavior of new data. In our implementation, we used scaled features to train and test our ML classifier. For the data points, net speeds ranged from 0 m/s to about 25 m/s and speeds ranged from 0 m/s to about 50 m/s. Their values were scaled between \(-\)1 and 1, with \"\(-\)1\" representing the slowest speed and \"1\" representing the greatest speed.