Not to be discouraging but I am not sure about this idea.
Why do you want to implement this algorithm in a smart contract? A clustering algorithm (as I understand it, is iterative) sounds very expensive to run on-chain.
Blockchains are (relatively) expensive, so we want to keep processing and data storage off chain wherever possible.
Remix IDE is great for simple contracts and experimenting. This is a good place to start.
For production smart contracts appropriate testing and auditing is required so suggest moving to OpenZeppelin SDK or Truffle etc and storing code and tests in version control e.g. GitHub.