使用 sql server 2008 决策树在 C# 中进行预测
我正在创建一个 C# 应用程序,我将通过给出一个简单的示例来解释我想要的内容:
考虑此表:
name age reply choice
------+-------+-------+-------
John 10-20 yes apple
Kate 20-30 yes orange
Sam 10-20 yes apple
Peter 10-20 no ----
Tom 20-30 no ----
Mike 10-20 yes orange
我想为所有已回复的人构建一个预测“年龄”决策树。然后预测那些没有回复的人的选择。
该表保存在 SQL Server 2008 数据库中。 SQL Server 2008 中有一个功能可以实现这一点。我搜索了微软帮助网站,但没有找到任何关于如何使用它的明确指南。
我如何在我的 C# 代码中使用它,有人有它的分步指南吗?
I am creating a C# application I will explain what I want by giving a simple example:
consider this table:
name age reply choice
------+-------+-------+-------
John 10-20 yes apple
Kate 20-30 yes orange
Sam 10-20 yes apple
Peter 10-20 no ----
Tom 20-30 no ----
Mike 10-20 yes orange
I would like to put together a predictive "age" decision tree for all the persons who have replied. and then predict the choices of the ones who didn't reply.
The table is saved in an SQL Server 2008 database. And there is a feature in the SQL Server 2008 that allows to do that. I searched the Microsoft help website but I didn't find any clear guide on how to use it.
How can I use it in my C# code, Anyone got a step by step guide for it?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这样就可以解决问题了:
只要找出每个年龄段提供最多的答案,然后如果没有给出,就选择那个答案。
当两个答案之间存在平局时,它只会选择一个。我认为是第一位的,但不能保证它总是会这样做。
请注意,如果您有一组答案为 A:B = 55%:45%,那么所有没有答案的人都会得到答案 A,因此您可以通过这样做来改变总体的平均值。只是让你知道。
This would do the trick:
Just find out what answer as provided the most for each age and then pick that answer if none was given.
When there is a tie between 2 answers, it just picks one. I think the one that comes first but the are no guarantees that it will always do that.
Be aware tho that if you have a group where the answers are A:B = 55%:45%, then all the people with no answer get answer A, so you'd change the averages of the population by doing this. Just so you know.