我想用C#中的文件数据实现k均值算法 [英] I want to implement k means algorithm using data from file in C#

查看:67
本文介绍了我想用C#中的文件数据实现k均值算法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有工作代码,但它使用静态数据。该数据包含两个尺寸的高度和重量。现在我想使用相同的代码,但应从文本文件中获取数据。该文本文件包含5维数据花卉数据(sepal_length,sepal_width,petal_length,petal_width,specie_name)。这些数据来自机器UCI学习库。

静态数据是双重类型,但我的文件数据也是字符串类型所以我在面对文本文件数据相同的代码时面临尺寸和类型问题。



i已经取得了工作代码来自



K-使用C#进行数据聚类 - Visual Studio Magazine [ ^ ]



我尝试了什么:



i已尝试保存静态字符串数组中的文本文件数据但是给出了类型错误。

i have working code but it use static data. This data contains two dimensions height and weight. Now i want to use same code but data should be taken from text file. This text file contain 5 dimensional data floral data (sepal_length, sepal_width, petal_length, petal_width, specie_name). this data is taken from machine UCI learning repository.
The static data is of double type but my file data is string type too so i am facing problem of dimensions and type while implementing same code with text file data.

i have taken working code from

K-Means Data Clustering Using C# -- Visual Studio Magazine[^]

What I have tried:

i have tried by saving text file data in static string array but that give type error.

推荐答案

问题在于你所做的改变:)

< a href =http://weblogs.asp.net/bleroy/asking-questions-is-a-skill>提出问题是一种技巧 [ ^ ]



您是否理解无法回答您的问题?

您解释说您在互联网上找到的代码中所做的更改以及您的更改无效。 您没有显示更改。

请记住,我们看不到您的屏幕,无法访问您的计算机(至少对于我们大多数人来说: )),不知道你脑子里有什么。
The problem is in the changes you have done :)
Asking questions is a skill[^]

Do you understand that it impossible to answer your question ?
You explain that you have done changes in a code you found on internet and that your changes don't work. You don't show your changes.
Keep in mind we don't see your screen, don't have access to your computer (at least for most of us :) ), don't know what is in your head.


这篇关于我想用C#中的文件数据实现k均值算法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆