Predicting particle properties in optical traps with machine learning