Sure it can, however machine learning is more of a number-crunching, blocking task which requires certain calculation between nodes. It is a fact, that JS is inherently bad at that kind of work. So you will be able to do a school-project, however I cannot see any real-life application with JS/Node.JS only.
If your project is based on Node.JS and you need some kind of interface, I recommend using the Node.JS C++ API or FFI bindings with a system programming language, like Rust, in order to get maximum performance and still be able to kick off certain tasks or feed data from your Node.JS program.