online compiler and debugger for c/c++

code. compile. run. debug. share.
Source Code   
Language
import numpy as np from sklearn.datasets import load_iris X = load_iris().data # selected data def kmeans(X, K, i=10): c = X[np.random.choice(len(X), K, 0)] for _ in range(i): l = ((X[:,None]-c)**2).sum(2).argmin(1) c = np.array([X[l==k].mean(0) for k in range(K)]) return l, c def sse(X, l, c): return sum(np.linalg.norm(x-c[k]) for x,k in zip(X,l)) for K in range(1,6): l,c = kmeans(X,K) print(K, sse(X,l,c))

Compiling Program...

Command line arguments:
Standard Input: Interactive Console Text
×

                

                

Program is not being debugged. Click "Debug" button to start program in debug mode.

#FunctionFile:Line
VariableValue
RegisterValue
ExpressionValue