Open Source Machine Learning Tools

Machine learning

WHAT IS MACHINE LEARNING?

Machine learning is the study of computer algorithms that can improve automatically through experience and by the use of data. It is seen as a part of artificial intelligence

What is machine learning?

Machine learning is a branch of artificial intelligence AI and computer science which focuses on the use of data and algorithms to imitate the way that humans learn, gradually improving its accuracy.

IBM has a rich history with machine learning. One of its own, Arthur Samuel, is credited for coining the term, “machine learning” with his research around the game of checkers. Robert Nealey, the self-proclaimed checkers master, played the game on an IBM 7094 computer in 1962, and he lost to the computer. Compared to what can be done today, this feat almost seems trivial, but it’s considered a major milestone within the field of artificial intelligence. Over the next couple of decades, the technological developments around storage and processing power will enable some innovative products that we know and love today, such as Netflix’s recommendation engine or self-driving cars.

Machine learning is an important component of the growing field of data science. Through the use of statistical methods, algorithms are trained to make classifications or predictions, uncovering key insights within data mining projects. These insights subsequently drive decision making within applications and businesses, ideally impacting key growth metrics. As big data continues to expand and grow, the market demand for data scientists will increase, requiring them to assist in the identification of the most relevant business questions and subsequently the data to answer them.

How machine learning works

UC Berkeley (link resides outside IBM) breaks out the learning system of a machine learning algorithm into three main parts.

  1. A Decision Process: In general, machine learning algorithms are used to make a prediction or classification. Based on some input data, which can be labelled or unlabeled, your algorithm will produce an estimate about a pattern in the data.
  2. An Error Function: An error function serves to evaluate the prediction of the model. If there are known examples, an error function can make a comparison to assess the accuracy of the model.
  3. A Model Optimization Process: If the model can fit better to the data points in the training set, then weights are adjusted to reduce the discrepancy between the known example and the model estimate. The algorithm will repeat this evaluate and optimize process, updating weights autonomously until a threshold of accuracy has been met.  

Machine learning methods

Machine learning classifiers fall into three primary categories.

Supervised machine learning            

Supervised learning, also known as supervised machine learning, is defined by its use of labeled datasets to train algorithms that to classify data or predict outcomes accurately. As input data is fed into the model, it adjusts its weights until the model has been fitted appropriately. This occurs as part of the cross validation process to ensure that the model avoids overfitting or underfitting. Supervised learning helps organizations solve for a variety of real-world problems at scale, such as classifying spam in a separate folder from your inbox. Some methods used in supervised learning include neural networks, naïve bayes, linear regression, logistic regression, random forest, support vector machine (SVM), and more.

Unsupervised machine learning

Unsupervised learning, also known as unsupervised machine learning, uses machine learning algorithms to analyze and cluster unlabeled datasets. These algorithms discover hidden patterns or data groupings without the need for human intervention. Its ability to discover similarities and differences in information make it the ideal solution for exploratory data analysis, cross-selling strategies, customer segmentation, image and pattern recognition. It’s also used to reduce the number of features in a model through the process of dimensionality reduction; principal component analysis (PCA) and singular value decomposition (SVD) are two common approaches for this. Other algorithms used in unsupervised learning include neural networks, k-means clustering, probabilistic clustering methods, and more.

Semi-supervised learning 

Semi-supervised learning offers a happy medium between supervised and unsupervised learning. During training, it uses a smaller labeled data set to guide classification and feature extraction from a larger, unlabeled data set. Semi-supervised learning can solve the problem of having not enough labeled data (or not being able to afford to label enough data) to train a supervised learning algorithm. 

5 key differences between machine learning and deep learning

While there are many differences between these two subsets of artificial intelligence, here are five of the most important:

1. Human Intervention

Machine learning requires more ongoing human intervention to get results. Deep learning is more complex to set up but requires minimal intervention thereafter.

2. Hardware

Machine learning programs tend to be less complex than deep learning algorithms and can often run on conventional computers, but deep learning systems require far more powerful hardware and resources. This demand for power has driven has meant increased use of graphical processing units. GPUs are useful for their high bandwidth memory and ability to hide latency (delays) in memory transfer due to thread parallelism (the ability of many operations to run efficiently at the same time.)

3. Time

Machine learning systems can be set up and operate quickly but may be limited in the power of their results. Deep learning systems take more time to set up but can generate results instantaneously (although the quality is likely to improve over time as more data becomes available).

4. Approach

Machine learning tends to require structured data and uses traditional algorithms like linear regression. Deep learning employs neural networks and is built to accommodate large volumes of unstructured data.

5. Applications

Machine learning is already in use in your email inbox, bank, and doctor’s office. Deep learning technology enables more complex and autonomous programs, like self-driving cars or robots that perform advanced surgery.

Challenges of machine learning

As machine learning technology advances, it has certainly made our lives easier. However, implementing machine learning within businesses has also raised a number of ethical concerns surrounding AI technologies. Some of these include:

Technological singularity

While this topic garners a lot of public attention, many researchers are not concerned with the idea of AI surpassing human intelligence in the near or immediate future. This is also referred to as superintelligence, which Nick Bostrum defines as “any intellect that vastly outperforms the best human brains in practically every field, including scientific creativity, general wisdom, and social skills.” Despite the fact that Strong AI and superintelligence is not imminent in society, the idea of it raises some interesting questions as we consider the use of autonomous systems, like self-driving cars. It’s unrealistic to think that a driverless car would never get into a car accident, but who is responsible and liable under those circumstances? Should we still pursue autonomous vehicles, or do we limit the integration of this technology to create only semi-autonomous vehicles which promote safety among drivers? The jury is still out on this, but these are the types of ethical debates that are occurring as new, innovative AI technology develops.

AI impact on jobs

While a lot of public perception around artificial intelligence centers around job loss, this concern should be probably reframed. With every disruptive, new technology, we see that the market demand for specific job roles shift. For example, when we look at the automotive industry, many manufacturers, like GM, are shifting to focus on electric vehicle production to align with green initiatives. The energy industry isn’t going away, but the source of energy is shifting from a fuel economy to an electric one. Artificial intelligence should be viewed in a similar manner, where artificial intelligence will shift the demand of jobs to other areas. There will need to be individuals to help manage these systems as data grows and changes every day. There will still need to be resources to address more complex problems within the industries that are most likely to be affected by job demand shifts, like customer service. The important aspect of artificial intelligence and its effect on the job market will be helping individuals transition to these new areas of market demand.

Privacy

Privacy tends to be discussed in the context of data privacy, data protection and data security, and these concerns have allowed policymakers to make more strides here in recent years. For example, in 2016, GDPR legislation was created to protect the personal data of people in the European Union and European Economic Area, giving individuals more control of their data. In the United States, individual states are developing policies, such as the California Consumer Privacy Act (CCPA), which require businesses to inform consumers about the collection of their data. This recent legislation has forced companies to rethink how they store and use personally identifiable data (PII). As a result, investments within security have become an increasing priority for businesses as they seek to eliminate any vulnerabilities and opportunities for surveillance, hacking, and cyberattacks.

Bias and discrimination

Instances of bias and discrimination across a number of intelligent systems have raised many ethical questions regarding the use of artificial intelligence. How can we safeguard against bias and discrimination when the training data itself can lend itself to bias? While companies typically have well-meaning intentions around their automation efforts, Reuters (link resides outside IBM) highlights some of the unforeseen consequences of incorporating AI into hiring practices. In their effort to automate and simplify a process, Amazon unintentionally biased potential job candidates by gender for open technical roles, and they ultimately had to scrap the project. As events like these surface, Harvard business review has raised other pointed questions around the use of AI within hiring practices, such as what data should you be able to use when evaluating a candidate for a role.

Bias and discrimination aren’t limited to the human resources function either; it can be found in a number of applications from facial recognition software to social media algorithms.

As businesses become more aware of the risks with AI, they’ve also become more active this discussion around AI ethics and values. For example, last year IBM’s CEO Arvind Krishna shared that IBM has sunset its general purpose IBM facial recognition and analysis products, emphasizing that “IBM firmly opposes and will not condone uses of any technology, including facial recognition technology offered by other vendors, for mass surveillance, racial profiling, violations of basic human rights and freedoms, or any purpose which is not consistent with our values and Principles of trust and transparency”

Accountability

Since there isn’t significant legislation to regulate AI practices, there is no real enforcement mechanism to ensure that ethical AI is practiced. The current incentives for companies to adhere to these guidelines are the negative repercussions of an unethical AI system to the bottom line. To fill the gap, ethical frameworks have emerged as part of a collaboration between ethicists and researchers to govern the construction and distribution of AI models within society. However, at the moment, these only serve to guide, and research (link resides outside IBM) (PDF, 1 MB) shows that the combination of distributed responsibility and lack of foresight into potential consequences isn’t necessarily conducive to preventing harm to society.

OPEN SOURCE MAHINE LEARNING TOOLS

Apache Mahout

Apache Mahout provides a way to build environments for hosting machine learning applications that can be scaled quickly and efficiently to meet demand. Mahout works mainly with another well-known Apache project, Spark, and was originally devised to work with Hadoop for the sake of running distributed applications, but has been extended to work with other distributed back ends like Flink and H2O.

Mahout uses a domain specific language in Scala. Version 0.14 is a major internal refactor of the project, based on Apache Spark 2.4.3 as its default.

Compose

Compose, by Innovation Labs, targets a common issue with machine learning models: labeling raw data, which can be a slow and tedious process, but without which a machine learning model can’t deliver useful results. Compose lets you write in Python a set of labeling functions for your data, so labeling can be done as programmatically as possible. Various transformations and thresholds can be set on your data to make the labeling process easier, such as placing data in bins based on discrete values or quantiles.

image

Core ML Tools

Apple’s Core ML framework lets you integrate machine learning models into apps, but uses its own distinct learning model format. The good news is you don’t have to pretrain models in the Core ML format to use them; you can convert models from just about every commonly used machine learning framework into Core ML with Core ML Tools.

Core ML Tools runs as a Python package, so it integrates with the wealth of Python machine learning libraries and tools. Models from TensorFlow, PyTorch, Keras, Caffe, ONNX, Scikit-learn, LibSVM, and XGBoost can all be converted. Neural network models can also be optimized for size by using post-training quantization (e.g., to a small bit depth that’s still accurate).

Cortex

Cortex provides a convenient way to serve predictions from machine learning models using Python and TensorFlow, PyTorch, Scikit-learn, and other models. Most Cortex packages consist of only a few files — your core Python logic, a cortex.yaml file that describes what models to use and what kinds of compute resources to allocate, and a requirements.txt file to install any needed Python requirements. The whole package is deployed as a Docker container to AWS or another Docker-compatible hosting system. Compute resources are allocated in a way that echoes the definitions used in Kubernetes for same, and you can use GPUs or Amazon Inferentia ASICs to speed serving.

Featuretools

Feature engineering, or feature creation, involves taking the data used to train a machine learning model and producing, typically by hand, a transformed and aggregated version of the data that’s more useful for the sake of training the model. Featuretools gives you functions for doing this by way of high-level Python objects built by synthesizing data in dataframes, and can do this for data extracted from one or multiple dataframes. Featuretools also provides common primitives for the synthesis operations (e.g., time_since_previous, to provide time elapsed between instances of time-stamped data), so you don’t have to roll those on your own.

GoLearn

GoLearn, a machine learning library for Google’s Go language, was created with the twin goals of simplicity and customizability, according to developer Stephen Whitworth. The simplicity lies in the way data is loaded and handled in the library, which is patterned after SciPy and R. The customizability lies in how some of the data structures can be easily extended in an application. Whitworth has also created a Go wrapper for the Vowpal Wabbit library, one of the libraries found in the Shogun toolbox.

Gradio

One common challenge when building machine learning applications is building a robust and easily customized UI for the model training and prediction-serving mechanisms. Gradio provides tools for creating web-based UIs that allow you to interact with your models in real time. Several included sample projects, such as input interfaces to the Inception V3 image classifier or the MNIST handwriting-recognition model, give you an idea of how you can use Gradio with your own projects.

H2O

H2O, now in its third major revision, provides a whole platform for in-memory machine learning, from training to serving predictions. H2O’s algorithms are geared for business processes—fraud or trend predictions, for instance—rather than, say, image analysis. H2O can interact in a stand-alone fashion with HDFS stores, on top of YARN, in MapReduce, or directly in an Amazon EC2 instance.

Hadoop mavens can use Java to interact with H2O, but the framework also provides bindings for Python, R, and Scala, allowing you to interact with all of the libraries available on those platforms as well. You can also fall back to REST calls as a way to integrate H2O into most any pipeline.

Oryx

Oryx, courtesy of the creators of the Cloudera Hadoop Distribution, uses Apache Spark and Apache Kafka to run machine learning models on real-time data. Oryx provides a way to build projects that require decisions in the moment, like recommendation engines or live anomaly detection, that are informed by both new and historical data. Version 2.0 is a near-complete redesign of the project, with its components loosely coupled in a lambda architecture. New algorithms, and new abstractions for those algorithms (e.g., for hyperparameter selection), can be added at any time.

PyTorch Lightning

When a powerful project becomes popular, it’s often complemented by third-party projects that make it easier to use. PyTorch Lightning provides an organizational wrapper for PyTorch, so that you can focus on the code that matters instead of writing boilerplate for each project.

Lightning projects use a class-based structure, so each common step for a PyTorch project is encapsulated in a class method. The training and validation loops are semi-automated, so you only need to provide your logic for each step. It’s also easier to set up the training results in multiple GPUs or different hardware mixes, because the instructions and object references for doing so are centralized.

Scikit-learn

Python has become a go-to programming language for math, science, and statistics due to its ease of adoption and the breadth of libraries available for nearly any application. Scikit-learn leverages this breadth by building on top of several existing Python packages—NumPy, SciPy, and Matplotlib—for math and science work. The resulting libraries can be used for interactive “workbench” applications or embedded into other software and reused. The kit is available under a BSD license, so it’s fully open and reusable.

Shogun

Shogun is one of the longest-lived projects in this collection. It was created in 1999 and written in C++, but can be used with Java, Python, C#, Ruby, R, Lua, Octave, and Matlab. The latest major version, 6.0.0, adds native support for Microsoft Windows and the Scala language.

Though popular and wide-ranging, Shogun has competition. Another C++-based machine learning library, Mlpack, has been around only since 2011, but professes to be faster and easier to work with (by way of a more integral API set) than competing libraries.

Spark MLlib

The machine learning library for Apache Spark and Apache Hadoop, MLlib boasts many common algorithms and useful data types, designed to run at speed and scale. Although Java is the primary language for working in MLlib, Python users can connect MLlib with the NumPy library, Scala users can write code against MLlib, and R users can plug into Spark as of version 1.5. Version 3 of MLlib focuses on using Spark’s DataFrame API (as opposed to the older RDD API), and provides many new classification and evaluation functions.

Another project, MLbasebuilds on top of MLlib to make it easier to derive results. Rather than write code, users make queries by way of a declarative language à la SQL.

Weka

Weka, created by the Machine Learning Group at the University of Waikato, is billed as “machine learning without programming.” It’s a GUI workbench that empowers data wranglers to assemble machine learning pipelines, train models, and run predictions without having to write code. Weka works directly with R, Apache Spark, and Python, the latter by way of a direct wrapper or through interfaces for common numerical libraries like NumPy, Pandas, SciPy, and Scikit-learn. Weka’s big advantage is that it provides browsable, friendly interfaces for every aspect of your job including package management, preprocessing, classification, and visualization.

Machine learning tools: Libraries and frameworks

TensorFlow: Machine learning at scale

Tensor flow is a computational framework for building machine learning models. The GoogleBrain team developed TensorFlow for their internal use and continue to use it for research and production across its products, giving it the credibility of delivering ML at scale.

The biggest use cases of TensorFlow tend to be in Image recognition, text classification, and natural language processing. In fact, GE uses TensorFlow to identify the anatomy of the brain in MRIs.

Scikit-learn: For a wide range of applications

Scikit-learn is a multi-purpose Python library, used primarily for data mining and analysis. It can be used across supervised and unsupervised algorithms for use cases in classification, regression, clustering, pre-processing and model selection.

Scikit-learn is favored by those working in spam detection, image recognition, text classification, etc.

Weka: Simplifying ML with a GUI

The biggest differentiator for Weka, a rather uncommon machine learning tool, is its graphical user interface (GUI). It accelerates the learning curve of those who aren’t confident of their coding skills, while also allowing confident programmers to call the Java library, as they need.

Weka is popular for data mining and exploration tasks such as pre-processing, classification, association, regression, clustering, and visualization.

The future of machine learning and deep learning

Machine and deep learning will affect our lives for generations to come and virtually every industry will be transformed by their capabilities. Dangerous jobs like space travel or work in harsh environments might be entirely replaced with machine involvement.

At the same time, people will turn to artificial intelligence to deliver rich new entertainment experiences that seem like the stuff of science fiction.

Careers in machine learning and deep learning

It will take the continued efforts of talented individuals to help machine and deep learning achieve their best results. While every field will have its own special needs in this space, there are some key career paths that already enjoy competitive hiring environments.

Data Scientists

Data Scientists work to compose the models and algorithms needed to pursue their industry’s goals. They also oversee the processing and analysis of data generated by the computers. This fast-growing career combines a need for coding expertise (Python, Java, etc.) with a strong understanding of the business and strategic goals of a company or industry.

Machine Learning Engineers

Machine Learning Engineers implement the data scientists’ models and integrate them into the complex data and technological ecosystems of the firm. They are also at the helm for the implementation/programming of automated controls or robots that take actions based on incoming data. This is critical work — the massive volume of data and computer processing power requires a high level of expertise and efficiency to be both cost- and resource-effective.

Drop your comment

Related Post

Leave a Reply

Your email address will not be published.