# Why Decision Tree boundary forms a square shape and SVM a circular/oval one?

I was going through a Udacity tutorial wherein a few data points were given and the exercise was to test which of the following models best fit the data: linear regression, decision tree, or SVM. Using sklearn, I was able to determine that that SVM is the best fit followed by decision tree. I got a very distinct decision boundary when these two algorithms were applied: Is there any specific reason for the said shapes or does it just depend on the data sets?

The code was quite straightforward; just reading the CSV, separating the features and then applying the algorithms as shown below:

from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC

import pandas
import numpy

# Split the data into X and y
X = numpy.array(data[['x1', 'x2']])
y = numpy.array(data['y'])

# import statements for the classification algorithms
from sklearn.linear_model import LogisticRegression
from sklearn.svm import SVC

# Logistic Regression Classifier
classifier = LogisticRegression()
classifier.fit(X,y)

# Decision Tree Classifier
classifier.fit(X,y)

# Support Vector Machine Classifier
classifier = SVC()
classifier.fit(X,y)


I found this slide very useful in understanding the rectangular decision boundaries generated by decision trees .
{"ft_lang_label":"__label__en","ft_lang_prob":0.8143929,"math_prob":0.88595665,"size":1341,"snap":"2020-10-2020-16","text_gpt3_token_len":272,"char_repetition_ratio":0.16679132,"word_repetition_ratio":0.08743169,"special_character_ratio":0.1961223,"punctuation_ratio":0.123893805,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9989799,"pos_list":[0,1,2,3,4],"im_url_duplicate_count":[null,5,null,5,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2020-02-21T16:35:00Z\",\"WARC-Record-ID\":\"<urn:uuid:0f509983-dd65-43ad-a27b-c9e9e4ff450f>\",\"Content-Length\":\"146953\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:f079b112-ad3b-4a4f-a7fa-bafef76393b2>\",\"WARC-Concurrent-To\":\"<urn:uuid:ee30e151-2d83-4006-913d-506e14615f6d>\",\"WARC-IP-Address\":\"151.101.1.69\",\"WARC-Target-URI\":\"https://datascience.stackexchange.com/questions/20548/why-decision-tree-boundary-forms-a-square-shape-and-svm-a-circular-oval-one/65411\",\"WARC-Payload-Digest\":\"sha1:V4QXKTFXTTDEGIGNB3PNJZOIGQGY4TT3\",\"WARC-Block-Digest\":\"sha1:4FNZLXLEQIQKFVANCIMXTWHJVRDWDUNI\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2020/CC-MAIN-2020-10/CC-MAIN-2020-10_segments_1581875145533.1_warc_CC-MAIN-20200221142006-20200221172006-00429.warc.gz\"}"}