Fix YAML tests for RegressionModel

Also moved the creation of a dict representation out to its own method.