我正在使用如下所示的数据集:
ClusterID URL Text_Body
0 www.text.com texttexttexttexttext.....
1 www.text1.com texttexttexttexttext.....
2 www.text2.com texttexttexttexttext.....
3 www.text3.com texttexttexttexttext.....
4 www.text4.com texttexttexttexttext.....
5 www.text5.com texttexttexttexttext.....
6 www.text6.com texttexttexttexttext.....
7 www.text7.com texttexttexttexttext.....
8 www.text8.com texttexttexttexttext.....
让我们称这个数据集为“onlinearticles”。 ClusterID是文章出现的集群,url是每篇文章的不同URL,文本正文是实际文章。我需要构建一个额外的列,为属于clusterID 0,4,6和7的任何行分配值1.任何其他clusterID的值应为0.我需要构建此列以进行回归树。我怎样才能建立这个专栏?