After completing some sequence methods, I have a design question about the development of the object (and its position) What is to say, I am having trouble bothering, so I may need to clear the question on the basis of feedback.
classifier Consider the object named: The methods are:
Start zero () Zero populistrain Gates (TrainingSetT) Zero Archaeological Setting Setting (Testing Set) Zero Train () Zero Test () Results Estimates (Example I)
My problem is that these methods are called in a certain order needed. Further, some methods are invalid unless the previous method is called, and after the method some methods are invalid. For example, before the test () was called, it would be invalid to call the prediction () before, and it would be invalid to call () the call after the test ().
Private static enum state {new, trained, tested, ready}; My attitude has been made so far to maintain a private enumeration which represents the purpose of the present state:
But it seems a bit claude Is there a design pattern for such problem type? Probably something related to the template method
OK, for this special case, I think you are here There are more designs on. For example, should you really distinguish between training dataset and test dataset in the context of their data? My suggestion would go with a factory pattern; You should have a machine algorithm factory with a "train" function, which gives a Hypothesis object on which you can "test" or "guess" the "train" function as its parameter, training data set While the "test" function should be taken as its parameter, the test data should be set. Both data sets are probably of the same type, because their form / structure is the same, even if the data contained in it is different. To make Datasets popular, this should not really worry about your machine learning algorithms; Anyone who uses algorithms should be responsible for providing a data set. If you want to set some type of example data, then I will suggest factories for adding various different trains / test data sets. Public Interface Results {Public Double getDecisionValue (); Public string received labels (); } Public Interface TestResult results {public string increases getActualLabel ()); } Public Interface TestResults is intended & lt; TestResult & gt; {Public int getErrorCount (); Public double getErrorRate (); } Public Interface Hypipesis {Public Test Response Test (iterable & lt; datapoint & gt; dataset, iterable & lt; string & gt; label); Public outcome predictions (datapoint datapoint); } Public Interface Machinelining Algorithm {Public Hypothesis Train (Iterable & lt; DataPoint & gt; trainset, Iterable & lt; string & gt; Tranelabel); }
Comments
Post a Comment