Fixed Workflow Segmentation Algorithm

Fixed training and testing phases of workflow segmentation algorithm. Now the segmentation matches the segmentation produced by Matlab code.