我已经将回归树与我的数据集相匹配,来自summary(tree1)的输出如下:
Regression tree:
tree(formula = y ~ X)
Variables actually used in tree construction:
character(0)
Number of terminal nodes: 1
Residual mean deviance: 0.985 = 71680 / 72770
Distribution of residuals:
Min. 1st Qu. Median Mean 3rd Qu. Max.
-1.0050
我有一个购物网站。我想要建立一个简单的预测模型来预测用户在一次访问后购买某一产品的可能性(在每个页面上花费的时间,她来自哪里,她有多少评论等),他可能离开一个页面等。
在Ruby on Rails、Python或Java中,有哪些工具可用于此任务?典型的统计建模技术,如逻辑回归,线性回归在这种情况下有效吗?
谢谢。
我试图通过python实现平衡的树检查,如下所示。
# Balanced tree definition:
# if tree's left and right sub tree are balanced, and their height difference is not bigger than 1, then the tree is balanced else not.
class Node:
def __init__(self, val):
self.left = None
self.right = None
self.