The three-way-in and three-way-out framework to treat and exploit ambiguity in data