[scikit-learn] sklearn.cluster.Birch

Sema Atasever s.atasever at gmail.com
Mon Apr 10 07:29:35 EDT 2017


Dear Manoj,

Thanks for your answer but when i execute the code below i get this error :
 "*ValueError: could not convert string to float:*"

How can i solve this error.

Regards.

---------------------------------------------
from sklearn.cluster import Birch
from io import StringIO
import numpy as np

X=np.loadtxt(open("C:\features.dat", "rb"), delimiter="\t")


brc = Birch(branching_factor=50, n_clusters=None,
threshold=0.5,compute_labels=True)
brc.fit(X)
Birch(branching_factor=50, compute_labels=True, copy=True,
n_clusters=None,threshold=0.5)
brc.predict(X)

print(brc.predict(X))

On Thu, Apr 6, 2017 at 4:29 PM, Manoj Kumar <manojkumarsivaraj334 at gmail.com>
wrote:

> Hi, See: https://docs.scipy.org/doc/numpy/reference/generated/
> numpy.loadtxt.html for one way.
>
> On Thu, Apr 6, 2017 at 8:27 AM, Sema Atasever <s.atasever at gmail.com>
> wrote:
>
>> Dear scikit-learn members,
>>
>> I have a dat file where the columns represent the features and the rows
>> represent the protein. (you can see the dat file in the attachment)
>>
>>
>> i want to use *sklearn.cluster.Birch* with this text file values as X
>> which is the
>>
>> Parameters:
>> X : {array-like, sparse matrix}
>>
>> How can i transform this text file values into X : {array-like, sparse
>> matrix}.
>>
>> I would appreciate if you could advise on some methods.
>> Thanks.
>>
>> _______________________________________________
>> scikit-learn mailing list
>> scikit-learn at python.org
>> https://mail.python.org/mailman/listinfo/scikit-learn
>>
>>
>
>
> --
> Manoj,
> http://github.com/MechCoder
>
> _______________________________________________
> scikit-learn mailing list
> scikit-learn at python.org
> https://mail.python.org/mailman/listinfo/scikit-learn
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/scikit-learn/attachments/20170410/5256f264/attachment.html>


More information about the scikit-learn mailing list