4.1 About Machine Learning Classes and Algorithms
These classes provide access to in-database machine learning algorithms.
Algorithm Classes
Class | Algorithm | Function of Algorithm | Description |
---|---|---|---|
ore.odmAI |
Minimum Description Length |
Attribute importance for classification or regression |
Ranks attributes according to their importance in predicting a target. |
ore.odmAssocRules |
Apriori |
Association rules |
Performs market basket analysis by identifying co-occurring items (frequent itemsets) within a set. |
ore.odmDT |
Decision Tree |
Classification |
Extracts predictive information in the form of human-understandable rules. The rules are if-then-else expressions; they explain the decisions that lead to the prediction. |
ore.odmEM |
Expectation Maximization |
Clustering | Performs probabilistic clustering based on a density estimation algorithm. |
ore.odmESA |
Explicit Semantic Analysis |
Feature extraction |
Extracts text-based features from a corpus of documents. Performs document similarity comparisons. |
ore.odmGLM |
Generalized Linear Model |
Classification Regression |
Implements logistic regression for classification of binary targets and linear regression for continuous targets. |
ore.odmKM |
k-Means |
Clustering |
Uses unsupervised learning to group data based on similarity into a predetermined number of clusters. |
ore.odmNB |
Naive Bayes |
Classification |
Makes predictions by deriving the probability of a prediction from the underlying evidence, as observed in the data. |
ore.odmNN |
Neural Network |
Classification Regression |
Learns from examples and tunes the weights of the connections among the neurons during the learning process. |
ore.odmRF |
Random Forest |
Classification |
Provides an ensemble learning technique for classification of data. |
ore.odmSVD |
Singular Value Decomposition |
Feature extraction |
Performs orthogonal linear transformations that capture the underlying variance of the data by decomposing a rectangular matrix into three matrices. |
ore.odmSVM |
Support Vector Machine |
Anomaly detection Classification Regression |
Builds a model that is a profile of a class, which, when the model is applied, identifies cases that are somehow different from that profile. |
ore.odmNMF |
Non-Negative Matrix Factorization |
Feature extraction |
A state of the art feature extraction algorithm used when there are many attributes and the attributes are ambiguous or have weak predictability. |
ore.odmXGB |
XGBoost |
Classification Regression |
Can be used as a stand-alone predictor or incorporate it into real-world production pipelines for a wide range of problems such as ad click-through rate prediction, hazard risk prediction, web text classification, and so on. |
Persisting Models
In-database models created through the OML4R API exist as temporary objects that are dropped when the database connection ends unless you take one of the following actions:
- Save a default-named model object in a datastore, as in the following example:
regr2 = ore.odmGLM("regression") ore.save(regr2, name = 'regression2', overwrite=TRUE)
- Use the
model_name
parameter when building the model to explicitly name in-database model proxy object, as in the following example:ore.drop(model='RF_CLASSIFICATION_MODEL') settings = list(RFOR_MTRY = 3, model_name="RF_CLASSIFICATION_MODEL") MOD2 <- ore.odmRF(AFFINITY_CARD~., DEMO_DF.train, odm.settings= settings) MOD2$name
- Change the name of an existing model using the
model_name
function of the model, as in the following example:regr2(model_name = 'myRegression2')
To drop a persistent named model, use the oml.drop
function.
Scoring New Data with a Model
For most of the OML4R machine learning classes, you can use the predict
method of the model object to score new data.
For in-database models, you can use the SQL PREDICTION
function on model proxy objects, which scores directly in the database. You can use in-database models directly from SQL if you prepare the data properly. For open source models, you can use Embedded R Execution and enable data-parallel execution for performance and scalability.
Deploying Models Through a REST API
The REST API for Oracle Machine Learning Services provides REST endpoints hosted on an Oracle Autonomous Database instance. These endpoints allow you to store OML models along with their metadata, and to create scoring endpoints for the models.
Parent topic: Reference