Working with parameters
Remember how the default formatter for an object only showed the public properties?
This can be a real problem when working with ML.NET in particular, as many aspects of a machine learning pipeline have no public ways of inspecting their current configurations. This makes it hard to see what settings a pipeline step has, which, in turn, makes it hard to understand your overall processing pipeline.
While a more formal solution to this problem would be to have those objects expose property getters for relevant information, I’ve worked around this by using reflection to show the internal state of objects. Reflection is .NET’s built-in ability to dynamically look over the composition of an object or class in terms of its properties, methods, and fields. We’re going to use reflection to build a Dictionary
of each property or field on an object. We’ll do that with this simplified ReflectObject
method implementation:
using System...