<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>OpenText Analytics Database 26.2.x – SVM (support vector machine) for regression</title>
    <link>/en/data-analysis/ml-predictive-analytics/regression-algorithms/svm-support-vector-machine-regression/</link>
    <description>Recent content in SVM (support vector machine) for regression on OpenText Analytics Database 26.2.x</description>
    <generator>Hugo -- gohugo.io</generator>
    
	  <atom:link href="/en/data-analysis/ml-predictive-analytics/regression-algorithms/svm-support-vector-machine-regression/index.xml" rel="self" type="application/rss+xml" />
    
    
      
        
      
    
    
    <item>
      <title>Data-Analysis: Building an SVM for regression model</title>
      <link>/en/data-analysis/ml-predictive-analytics/regression-algorithms/svm-support-vector-machine-regression/building-an-svm-regression-model/</link>
      <pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate>
      
      <guid>/en/data-analysis/ml-predictive-analytics/regression-algorithms/svm-support-vector-machine-regression/building-an-svm-regression-model/</guid>
      <description>
        
        
        &lt;p&gt;This SVM for regression example uses a small data set named faithful, based on the Old Faithful geyser in Yellowstone National Park. The data set contains values about the waiting time between eruptions and the duration of eruptions of the geyser. The example shows how you can build a model to predict the value of &lt;code&gt;eruptions&lt;/code&gt;, given the value of the &lt;code&gt;waiting&lt;/code&gt; feature.&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;Create the SVM model, named &lt;code&gt;svm_faithful&lt;/code&gt;, using the &lt;code&gt;faithful_training&lt;/code&gt; training data:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT SVM_REGRESSOR(&amp;#39;svm_faithful&amp;#39;, &amp;#39;faithful_training&amp;#39;, &amp;#39;eruptions&amp;#39;, &amp;#39;waiting&amp;#39;
                      USING PARAMETERS error_tolerance=0.1, max_iterations=100);
        SVM_REGRESSOR
---------------------------
 Finished in 5 iterations
Accepted Rows: 162   Rejected Rows: 0
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;View the summary output of &lt;code&gt;svm_faithful&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;svm_faithful&amp;#39;);

------------------------------------------------------------------
=======
details
=======

===========================
Predictors and Coefficients
===========================
         |Coefficients
---------+------------
Intercept|  -1.59007
waiting  |   0.07217
===========
call_string
===========
Call string:
SELECT svm_regressor(&amp;#39;public.svm_faithful&amp;#39;, &amp;#39;faithful_training&amp;#39;, &amp;#39;&amp;#34;eruptions&amp;#34;&amp;#39;,
&amp;#39;waiting&amp;#39;USING PARAMETERS error_tolerance = 0.1, C=1, max_iterations=100,
epsilon=0.001);

===============
Additional Info
===============
Name              |Value
------------------+-----
accepted_row_count| 162
rejected_row_count|  0
iteration_count  |  5
(1 row)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Create a new table that contains the response values from running the &lt;code&gt;PREDICT_SVM_REGRESSOR&lt;/code&gt; function on your test data. Name this table &lt;code&gt;pred_faithful_results.&lt;/code&gt;  View the results in the &lt;code&gt;pred_faithful_results&lt;/code&gt; table:&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; CREATE TABLE pred_faithful AS
       (SELECT id, eruptions, PREDICT_SVM_REGRESSOR(waiting USING PARAMETERS model_name=&amp;#39;svm_faithful&amp;#39;)
        AS pred FROM faithful_testing);
CREATE TABLE
=&amp;gt; SELECT * FROM pred_faithful ORDER BY id;
 id  | eruptions |       pred
-----+-----------+------------------
   4 |     2.283 | 2.88444568755189
   5 |     4.533 | 4.54434581879796
   8 |       3.6 | 4.54434581879796
   9 |      1.95 | 2.09058040739072
  11 |     1.833 | 2.30708912016195
  12 |     3.917 | 4.47217624787422
  14 |      1.75 | 1.80190212369576
  20 |      4.25 | 4.11132839325551
  22 |      1.75 | 1.80190212369576
.
.
.
(110 rows)
&lt;/code&gt;&lt;/pre&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2 id=&#34;calculating-the-mean-squared-error-mse&#34;&gt;Calculating the mean squared error (MSE)&lt;/h2&gt;
&lt;p&gt;You can calculate how well your model fits the data is by using the MSE function. MSE returns the average of the squared differences between actual value and predicted values.&lt;/p&gt;
&lt;pre tabindex=&#34;0&#34;&gt;&lt;code&gt;=&amp;gt; SELECT MSE(obs::float, prediction::float) OVER()
   FROM (SELECT eruptions AS obs, pred AS prediction
         FROM pred_faithful) AS prediction_output;
        mse        |                   Comments
-------------------+-----------------------------------------------
 0.254499811834235 | Of 110 rows, 110 were used and 0 were ignored
(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/regression-algorithms/svm-support-vector-machine-regression/#&#34;&gt;SVM (support vector machine) for regression&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/ml-functions/ml-algorithms/svm-regressor/#&#34;&gt;SVM_REGRESSOR&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;
&lt;a href=&#34;../../../../../en/sql-reference/functions/ml-functions/transformation-functions/predict-svm-regressor/#&#34;&gt;PREDICT_SVM_REGRESSOR&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;

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