<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – ANOMALY DETECTION</title>
    <link>/en/sql-reference/functions/ml-functions/ml-algorithms/anomalydetection/</link>
    <description>Recent content in ANOMALY DETECTION on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/sql-reference/functions/ml-functions/ml-algorithms/anomalydetection/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Sql-Reference: IFOREST</title>
      <link>/en/sql-reference/functions/ml-functions/ml-algorithms/anomalydetection/iforest/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/sql-reference/functions/ml-functions/ml-algorithms/anomalydetection/iforest/</guid>
      <description>
        
        
        &lt;p&gt;Trains and returns an isolation forest (iForest) model. After you train the model, you can use the &lt;a href=&#34;../../../../../../en/sql-reference/functions/ml-functions/transformation-functions/apply-iforest/#&#34;&gt;APPLY_IFOREST&lt;/a&gt; function to predict outliers in an input relation.&lt;/p&gt;
&lt;p&gt;For more information about how the iForest algorithm works, see &lt;a href=&#34;../../../../../../en/data-analysis/ml-predictive-analytics/data-preparation/detect-outliers/#iForest&#34;&gt;Isolation Forest&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;This is a meta-function. You must call meta-functions in a top-level &lt;a href=&#34;../../../../../../en/sql-reference/statements/select/#&#34;&gt;SELECT&lt;/a&gt; statement.&lt;/p&gt;

&lt;h2 id=&#34;behavior-type&#34;&gt;Behavior type&lt;/h2&gt;
&lt;a class=&#34;glosslink&#34; href=&#34;../../../../../../en/glossary/volatile-functions/&#34; title=&#34;&#34;&gt;Volatile&lt;/a&gt;
&lt;h2 id=&#34;syntax&#34;&gt;Syntax&lt;/h2&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;IFOREST( &lt;span class=&#34;code-variable&#34;&gt;&#39;model-name&#39;&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;&#39;input-relation&#39;&lt;/span&gt;, &lt;span class=&#34;code-variable&#34;&gt;&#39;input-columns&#39;&lt;/span&gt; [ USING PARAMETERS &lt;span class=&#34;code-variable&#34;&gt;param&lt;/span&gt;=&lt;span class=&#34;code-variable&#34;&gt;value&lt;/span&gt;[,...] ] )
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;arguments&#34;&gt;Arguments&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;model-name&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Identifies the model to create, where &lt;em&gt;&lt;code&gt;model-name&lt;/code&gt;&lt;/em&gt; conforms to conventions described in &lt;a href=&#34;../../../../../../en/sql-reference/language-elements/identifiers/#&#34;&gt;Identifiers&lt;/a&gt;. It must also be unique among all names of sequences, tables, projections, views, and models within the same schema.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input-relation&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;The table or view that contains the input data for IFOREST.&lt;/dd&gt;
&lt;dt&gt;&lt;em&gt;&lt;code&gt;input-columns&lt;/code&gt;&lt;/em&gt;&lt;/dt&gt;
&lt;dd&gt;Comma-separated list of columns to use from the input relation, or asterisk (*) to select all columns. Columns must be of types CHAR, VARCHAR, BOOL, INT, or FLOAT.
&lt;p&gt;Columns of types CHAR, VARCHAR, and BOOL are treated as categorical features; all others are treated as numeric features.&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;parameters&#34;&gt;Parameters&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;exclude_columns&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Comma-separated list of column names from &lt;em&gt;&lt;code&gt;input-columns&lt;/code&gt;&lt;/em&gt; to exclude from processing.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; Empty string (&#39;&#39;)&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;ntree&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Integer in the range [1, 1000], specifies the number of trees in the forest.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 100&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;sampling_size&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Float in the range (0.0, 1.0], specifies the portion of the input data set that is randomly picked, without replacement, for training each tree.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 0.632&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;col_sample_by_tree&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Float in the range (0.0, 1.0], specifies the fraction of columns that are randomly picked for training each tree.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 1.0&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;max_depth&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Integer in the range [1, 100], specifies the maximum depth for growing each tree.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 10&lt;/p&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;nbins&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Integer in the range [2, 1000], specifies the number of bins used to discretize continuous features.
&lt;p&gt;&lt;strong&gt;Default:&lt;/strong&gt; 32&lt;/p&gt;
&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;model-attributesbr-&#34;&gt;Model Attributes&lt;br /&gt;&lt;/h2&gt;
&lt;dl&gt;
&lt;dt&gt;&lt;code&gt;details&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Details about the function&#39;s predictor columns, including:
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;predictor&lt;/code&gt;: Names of the predictors in the same order specified when training the model.&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;code&gt;type&lt;/code&gt;: Types of the predictors in the same order as their names in &lt;code&gt;predictor&lt;/code&gt;.&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;
&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;tree_count&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Number of trees in the model.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;rejected_row_count&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Number of rows in &lt;em&gt;&lt;code&gt;input-relation&lt;/code&gt;&lt;/em&gt; that were skipped because they contained an invalid value.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;accepted_row_count&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Total number of rows in &lt;em&gt;&lt;code&gt;input-relation&lt;/code&gt;&lt;/em&gt; minus &lt;code&gt;rejected_row_count&lt;/code&gt;.&lt;/dd&gt;
&lt;dt&gt;&lt;code&gt;call_string&lt;/code&gt;&lt;/dt&gt;
&lt;dd&gt;Value of all input arguments that were specified at the time the function was called.&lt;/dd&gt;
&lt;/dl&gt;
&lt;h2 id=&#34;privileges&#34;&gt;Privileges&lt;/h2&gt;
&lt;p&gt;Non-superusers:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;CREATE privileges on the schema where the model is created&lt;/p&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;SELECT privileges on the input relation&lt;/p&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h2 id=&#34;examples&#34;&gt;Examples&lt;/h2&gt;
&lt;p&gt;In the following example, the input data to the function contains columns of type INT, VARCHAR, and FLOAT:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT IFOREST(&amp;#39;baseball_anomalies&amp;#39;,&amp;#39;baseball&amp;#39;,&amp;#39;team, hr, hits, avg, salary&amp;#39; USING PARAMETERS ntree=75, sampling_size=0.7,
max_depth=15);
IFOREST
----------
Finished
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;p&gt;You can verify that all the input columns were read in correctly by calling &lt;a href=&#34;../../../../../../en/sql-reference/functions/ml-functions/model-management/get-model-summary/#&#34;&gt;GET_MODEL_SUMMARY&lt;/a&gt; and checking the details section:&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;baseball_anomalies&amp;#39;);
GET_MODEL_SUMMARY
-------------------------------------------------------------------------------------------------------------------------------------

===========
call_string
===========
SELECT iforest(&amp;#39;public.baseball_anomalies&amp;#39;, &amp;#39;baseball&amp;#39;, &amp;#39;team, hr, hits, avg, salary&amp;#39; USING PARAMETERS exclude_columns=&amp;#39;&amp;#39;, ntree=75,
sampling_size=0.7, col_sample_by_tree=1, max_depth=15, nbins=32);

=======
details
=======
predictor|      type
---------+----------------
  team   |char or varchar
   hr    |      int
  hits   |      int
   avg   |float or numeric
 salary  |float or numeric


===============
Additional Info
===============
       Name       |Value
------------------+-----
    tree_count    | 75
rejected_row_count|  0
accepted_row_count|1000

(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;h2 id=&#34;see-also&#34;&gt;See also&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../../en/data-analysis/ml-predictive-analytics/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/transformation-functions/apply-iforest/#&#34;&gt;APPLY_IFOREST&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../../en/sql-reference/functions/ml-functions/model-evaluation/read-tree/#&#34;&gt;READ_TREE&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

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