K-means, ID3, HITS implementation from scratch