- Join over
**1.5M+ people** - Join over
**100K+ communities** - Free
**without limits** - Create
**your own community**

Is the R way

Also for n categorical to n binary columns... are we trying to make dummy variables here?

I ended up just using Fork instead of trying to do some complicated multithreading stuff.

;)

I'm going to fire up a cyclops.io video chat

if anybody cares to join me

like what are the steps

or so /

?

just saw this.

Natural language processing is the field it is in.

I haven't built one myself, but this is a good place to start:

I was trying to make a program for image compression using k means clustering

Can someone tell me whatâ€™s wrong with this code?

from scipy import misc

import numpy as np

from scipy.misc import toimage

img=misc.imread('bird_small.png')

img=img.reshape((16384,3))

def findc(X,incd) :

c=[]

```
for j in range(0,16384):
k1 = []
for i in range(0,16):
k=X[j]-incd[i]
k1.append(k.dot(k.transpose()))
print(j)
c.append(np.argmax(k1))
return c
```

def findu(X,u):

u=np.zeros((16,3))

a=np.zeros(16)

for j in range(0,16384):

for i in range(0,16):

if(c[j]==i):

u[i]=u[i]+X[j]

a[i]=a[i]+1

```
newc=[]
for i in range(0,16):
newc.append(u[i]/a[i])
return newc
```

incd = np.random.randint(np.size(img,axis=0), size=16)

print(np.size(img,axis=0))

incd = img[incd, :]

incd = incd.reshape((16, 3))

print(incd)

for _ in range(0,10):

c=findc(img,incd)

prevcd=incd

incd=findu(img,c)

for j in range(0,16384):

for i in range(0, 16):

if (c[j] == i):

img[j]=incd[i]

img.reshape((128,128,3))

toimage(img).show()

This is the algorithm which I have implemented using Java.