<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – Classification algorithms</title>
    <link>/en/data-analysis/ml-predictive-analytics/classification-algorithms/</link>
    <description>Recent content in Classification algorithms on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/data-analysis/ml-predictive-analytics/classification-algorithms/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Data-Analysis: Logistic regression</title>
      <link>/en/data-analysis/ml-predictive-analytics/classification-algorithms/logistic-regression/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/classification-algorithms/logistic-regression/</guid>
      <description>
        
        
        &lt;p&gt;Using logistic regression, you can model the relationship between independent variables, or features, and some dependent variable, or outcome. The outcome of logistic regression is always a binary value.&lt;/p&gt;
&lt;p&gt;You can build logistic regression models to:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;Fit a predictive model to a training data set of independent variables and some binary dependent variable. Doing so allows you to make predictions on outcomes, such as whether a piece of email is spam mail or not.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Determine the strength of the relationship between an independent variable and some binary outcome variable. For example, suppose you want to determine whether an email is spam or not. You can build a logistic regression model, based on observations of the properties of email messages. Then, you can determine the importance of various properties of an email message on that outcome.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can use the following functions to build a logistic regression model, view the model, and use the model to make predictions on a set of test data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/logistic-reg/#&#34;&gt;LOGISTIC_REG&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-logistic-reg/#&#34;&gt;PREDICT_LOGISTIC_REG&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/#&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a complete programming example of how to use logistic regression on a database table, see &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/classification-algorithms/logistic-regression/building-logistic-regression-model/#&#34;&gt;Building a logistic regression model&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Data-Analysis: Naive bayes</title>
      <link>/en/data-analysis/ml-predictive-analytics/classification-algorithms/naive-bayes/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/classification-algorithms/naive-bayes/</guid>
      <description>
        
        
        &lt;p&gt;You can use the Naive Bayes algorithm to classify your data when features can be assumed independent. The algorithm uses independent features to calculate the probability of a specific class. For example, you might want to predict the probability that an email is spam. In that case, you would use a corpus of words associated with spam to calculate the probability the email&#39;s content is spam.&lt;/p&gt;
&lt;p&gt;You can use the following functions to build a Naive Bayes model, view the model, and use the model to make predictions on a set of test data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/naive-bayes/#&#34;&gt;NAIVE_BAYES&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-naive-bayes/#&#34;&gt;PREDICT_NAIVE_BAYES&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-naive-bayes-classes/#&#34;&gt;PREDICT_NAIVE_BAYES_CLASSES&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/#&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a complete example of how to use the Naive Bayes algorithm, see &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/classification-algorithms/naive-bayes/classifying-data-using-naive-bayes/#&#34;&gt;Classifying data using naive bayes&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Data-Analysis: Random forest for classification</title>
      <link>/en/data-analysis/ml-predictive-analytics/classification-algorithms/random-forest-classification/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/classification-algorithms/random-forest-classification/</guid>
      <description>
        
        
        &lt;p&gt;The Random Forest algorithm creates an ensemble model of decision trees. Each tree is trained on a randomly selected subset of the training data.&lt;/p&gt;
&lt;p&gt;You can use the following functions to train the Random Forest model, and use the model to make predictions on a set of test data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/rf-classifier/#&#34;&gt;RF_CLASSIFIER&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-rf-classifier/#&#34;&gt;PREDICT_RF_CLASSIFIER&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-rf-classifier-classes/#&#34;&gt;PREDICT_RF_CLASSIFIER_CLASSES&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/#&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a complete example of how to use the Random Forest algorithm, see &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/classification-algorithms/random-forest-classification/classifying-data-using-random-forest/#&#34;&gt;Classifying data using random forest&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Data-Analysis: SVM (support vector machine) for classification</title>
      <link>/en/data-analysis/ml-predictive-analytics/classification-algorithms/svm-support-vector-machine-classification/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/classification-algorithms/svm-support-vector-machine-classification/</guid>
      <description>
        
        
        &lt;p&gt;Support Vector Machine (SVM) is a classification algorithm that assigns data to one category or the other based on the training data. This algorithm implements linear SVM, which is highly scalable.&lt;/p&gt;
&lt;p&gt;You can use the following functions to train the SVM model, and use the model to make predictions on a set of test data:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/svm-classifier/#&#34;&gt;SVM_CLASSIFIER&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-svm-classifier/#&#34;&gt;PREDICT_SVM_CLASSIFIER&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/#&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;You can also use the following evaluation functions to gain further insights:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-evaluation/confusion-matrix/#&#34;&gt;CONFUSION_MATRIX&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/data-preparation/detect-outliers/#&#34;&gt;DETECT_OUTLIERS&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-evaluation/error-rate/#&#34;&gt;ERROR_RATE&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-evaluation/roc/#&#34;&gt;ROC&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;For a complete example of how to use the SVM algorithm, see &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/classification-algorithms/svm-support-vector-machine-classification/classifying-data-using-svm-support-vector-machine/#&#34;&gt;Classifying data using SVM (support vector machine)&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;The implementation of the SVM algorithm is based on the paper &lt;a href=&#34;https://link.springer.com/chapter/10.1007/978-3-319-18032-8_54&#34;&gt;Distributed Newton Methods for Regularized Logistic Regression&lt;/a&gt;.&lt;/p&gt;

      </description>
    </item>
    
    <item>
      <title>Data-Analysis: XGBoost for classification</title>
      <link>/en/data-analysis/ml-predictive-analytics/classification-algorithms/xgboost-classification/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/classification-algorithms/xgboost-classification/</guid>
      <description>
        
        
        &lt;p&gt;&lt;a href=&#34;https://machinelearningmastery.com/gentle-introduction-xgboost-applied-machine-learning/&#34;&gt;XGBoost&lt;/a&gt; (eXtreme Gradient Boosting) is a popular supervised-learning algorithm used for regression and classification on large datasets. It uses sequentially-built shallow decision trees to provide accurate results and a highly-scalable training method that avoids overfitting.&lt;/p&gt;

&lt;p&gt;The following XGBoost functions create and perform predictions with a classification model:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/xgb-classifier/#&#34;&gt;XGB_CLASSIFIER&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-xgb-classifier/#&#34;&gt;PREDICT_XGB_CLASSIFIER&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;li&gt;

&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-xgb-classifier-classes/#&#34;&gt;PREDICT_XGB_CLASSIFIER_CLASSES&lt;/a&gt;&lt;/code&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;h2 id=&#34;example&#34;&gt;Example&lt;/h2&gt;
&lt;p&gt;This example uses the &amp;quot;iris&amp;quot; dataset, which contains measurements for various parts of a flower, and can be used to predict its species and creates an XGBoost classifier model to classify the species of each flower.&lt;/p&gt;
Before you begin the example, &lt;a href=&#34;../../../../en/data-analysis/ml-predictive-analytics/download-ml-example-data/&#34;&gt;load the Machine Learning sample data&lt;/a&gt;.
&lt;ol&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/ml-algorithms/xgb-classifier/#&#34;&gt;XGB_CLASSIFIER&lt;/a&gt;&lt;/code&gt; to create the XGBoost classifier model &lt;code&gt;xgb_iris&lt;/code&gt; using the &lt;code&gt;iris&lt;/code&gt; dataset:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT XGB_CLASSIFIER (&amp;#39;xgb_iris&amp;#39;, &amp;#39;iris&amp;#39;, &amp;#39;Species&amp;#39;, &amp;#39;Sepal_Length, Sepal_Width, Petal_Length, Petal_Width&amp;#39;
    USING PARAMETERS max_ntree=10, max_depth=5, weight_reg=0.1, learning_rate=1);
 XGB_CLASSIFIER
----------------
 Finished
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can then view a summary of the model with 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/#&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt;&lt;/code&gt;:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;
=&amp;gt; SELECT GET_MODEL_SUMMARY(USING PARAMETERS model_name=&amp;#39;xgb_iris&amp;#39;);
                                                                                                                                                                       GET_MODEL_SUMMARY
------------------------------------------------------
===========
call_string
===========
xgb_classifier(&amp;#39;public.xgb_iris&amp;#39;, &amp;#39;iris&amp;#39;, &amp;#39;&amp;#34;species&amp;#34;&amp;#39;, &amp;#39;Sepal_Length, Sepal_Width, Petal_Length, Petal_Width&amp;#39;
USING PARAMETERS exclude_columns=&amp;#39;&amp;#39;, max_ntree=10, max_depth=5, nbins=32, objective=crossentropy,
split_proposal_method=global, epsilon=0.001, learning_rate=1, min_split_loss=0, weight_reg=0.1, sampling_size=1)

=======
details
=======
 predictor  |      type
------------+----------------
sepal_length|float or numeric
sepal_width |float or numeric
petal_length|float or numeric
petal_width |float or numeric


===============
Additional Info
===============
       Name       |Value
------------------+-----
    tree_count    |  10
rejected_row_count|  0
accepted_row_count| 150

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-xgb-classifier/#&#34;&gt;PREDICT_XGB_CLASSIFIER&lt;/a&gt;&lt;/code&gt; to apply the classifier to the test data:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_XGB_CLASSIFIER (Sepal_Length, Sepal_Width, Petal_Length, Petal_Width
    USING PARAMETERS model_name=&amp;#39;xgb_iris&amp;#39;) FROM iris1;
 PREDICT_XGB_CLASSIFIER
------------------------
 setosa
 setosa
 setosa
 .
 .
 .
 versicolor
 versicolor
 versicolor
 .
 .
 .
 virginica
 virginica
 virginica
 .
 .
 .

(90 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Use 
&lt;code&gt;&lt;a href=&#34;../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-xgb-classifier-classes/#&#34;&gt;PREDICT_XGB_CLASSIFIER_CLASSES&lt;/a&gt;&lt;/code&gt; to view the probability of each class:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT PREDICT_XGB_CLASSIFIER_CLASSES(Sepal_Length, Sepal_Width, Petal_Length, Petal_Width
    USING PARAMETERS model_name=&amp;#39;xgb_iris&amp;#39;) OVER (PARTITION BEST) FROM iris1;
  predicted  |    probability
------------+-------------------
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     | 0.999911552783011
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 setosa     |   0.9999650465368
 versicolor |  0.99991871763563
 .
 .
 .
(90 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

      </description>
    </item>
    
  </channel>
</rss>
