I am having some doubt in the python SVM implementation tutorial with the code of fit function. Can someone explain this in brief.Why in in the below snippet we are finding maximum and minimum of whole data set? Shouldn't it be max and min of each feature in the dataset?
all_data = [] for yi in self.data: for featureset in self.data[yi]: for feature in featureset: all_data.append(feature)
self.max_feature_value = max(all_data) self.min_feature_value = min(all_data) # no need to keep this memory. all_data=None
What is this code doing ? Why max value of feature is taken in this?
step_sizes = [self.max_feature_value * 0.1, self.max_feature_value * 0.01, # starts getting very high cost after this. self.max_feature_value * 0.001]
You must be logged in to post. Please login or register an account.
Have you gone to part 2? https://pythonprogramming.net/svm-optimization-python-2-machine-learning-tutorial/
That's where we actually use it for iterating through possible values.
-Harrison 7 years ago
You must be logged in to post. Please login or register an account.