# How does a decision tree split a continuous feature?

Decision trees learn by measuring the quality of a split through some function, apply this to all features and you get the best feature to split on.

However, with a continuous feature it becomes problematic because there are an infinite number of ways you can split the feature. How is the optimal split for a continuous feature chosen?

The algorithm used for continuous feature is Reduction of variance. For continuous feature, decision tree calculates total weighted variance of each splits. The minimum variance from these splits is chosen as criteria to split.