def learn(self)"""returns predictora function from tuple to value for the target feature ""raise notimplementederror("learn"abstract method learning with no input features if we make the same prediction for each examplewhat prediction should we makethis can be used as naive baselineif more sophisticated method does not do better than thisit is not useful this also provides the base case for some methodssuch as decision-tree learning to run demo to compare different prediction methods on various evaluation criteriain folder "aipython"load "learnnoinputs py"using ipython - learnnoinputs pyand it prints some test results there are few alternatives as to what could be allowed in predictiona point predictionwhere we are only allowed to predict one of the values of the feature for exampleif the values of the feature are { we are only allowed to predict or or of the values are ratings in { }we can only predict one of these integers point predictionwhere we are allowed to predict any value for exampleif the values of the feature are { we may be allowed to predict or even for all of the criteria we can imaginethere is no point in predicting value greater than or less that zero (but that doesn' mean we can' )but it is often useful to predict value between and if the values are ratings in { }we may want to predict probability distribution over the values of the feature for each value vwe predict non-negative number pv such that the sum over all predictions is for regressionwe do the first of these for classificationwe do the second the third can be implemented by having multiple indicator functions for the target here are some prediction functions that take in an enumeration of valuesa domainand returns value or dictionary of {value predictionnote that cmedian returns one of middle values when there are an even number of exampleswhereas median gives the average of them (and so cmedian is applicable for ordinals that cannot be considered cardinal valuessimilarlycmode picks one of the values when more than one value has the maximum number of elements version june