I have a separable 2 class spiral data, namely blue and red, spiraling out from origin. I know KNN and SVM are suitable for the classification prupose, but i wonder can I achieve not-bad classifying result using log regression?
I had tried couple of features like (r and theta), (sinx, siny, r), and more. but none seems to work well
SVMs are a linear model that can implicitly transform features to a higher-dimensional space. If you transform the features beforehand and then feed them into a logistic regression, you can get similar results to an SVM (the models define and optimise different objectives, so their decision boundaries won't be the same).
The code below explicity maps features to an RBF space (an RBF SVM does this implicity), and then supplies those transformed features to
LogisticRegression(). Results fromSVM(kernel='rbf')are included for comparison.