The TrainingData Class
Explore how the TrainingData class coordinates samples and hyperparameters in a Python object-oriented application. Learn how load() separates training and testing data, while test() and classify() delegate work to Hyperparameter objects. Understand type hints, class responsibilities, direct attribute access, and iterative design.
We'll cover the following...
The TrainingData class has listed two subclasses of Sample objects. The KnownSample and UnknownSample can be implemented as extensions to a common parent class, Sample.
Methods
The TrainingData class also has a list with Hyperparameter instances. This class can have simple, direct references to previously defined classes.
This class has two methods that initiate the processing:
-
The
load()method reads raw data and partitions it into training data and test data. Both of these are essentiallyKnownSampleinstances with different purposes. The ...