sklearn.tree._classes.BaseDecisionTree#fit
y
至少为1维(意思是可以处理multilabels
数据)
y = np.atleast_1d(y)
if is_classifier(self):
self.tree_ = Tree(self.n_features_,
self.n_classes_, self.n_outputs_)
else:
self.tree_ = Tree(self.n_features_,
# TODO: tree should't need this in this case
np.array([1] * self.n_outputs_, dtype=np.intp),
self.n_outputs_)
self.n_outputs_ = y.shape[1]
self.n_classes_ = self.n_classes_[0]
self.n_classes_ = []
for k in range