Machine Learning is any algorithm that takes data (be it text, image, audio, video or anything that can be called as data) as the input, understands the pattern that underlies in the data and uses the understood pattern to predict the outcome of the new data.
Any algorithm or technique that allows computing devices to make decisions or solve problems that previously required humans to perform them manually can be called an AI algorithm or technique. An AI can be either a huge stack of simple if-else statements or a very complex algorithm.
Usually is use the library (somebody already build the learning model)
The JS library is brain.js
The Python library is... Scikit
Quote from Kuba
Depends on what you need exactly, but scikit-learn (sklearn) is the largest open source library for applying machine learning algorithms.
For deep learning, the most active now are: tensorflow and pytorch (backed by Google and Facebook, respectively), mxnet (Apache) and cntk (Microsoft). Each has its followers :)