File Exchange > Data Analysis >    SVM Classification

Author:
OriginLab Technical Support
Date Added:
3/25/2020
Last Update:
10/14/2024
Downloads (90 Days):
582
Total Ratings:
9
File Size:
52 KB
Average Rating:
File Name:
SVM Classi...on.opx
File Version:
2.20
Minimum Versions:
License:
Free
Type:
App
Summary:

Support vector machine for classification.

Screen Shot and Video:
Description:

  • Note: Scikit-learn library is used for this app, so some related python libraries are needed for this app, such as setuptools, numpy, scipy, scikit-learn, scikit-image, and their dependent libraries. You can use pip to install them first.
  • Purpose
    This app can be used to perform the support vector machine algorithm for classification.
  • Features Include:
    • Peform support vector machine algorithm and output the related parameters.
    • Predict the class labels for specified data.
    • Multiple kernels are supported, including linear, poly, rbf, and sigmoid.
    • Decision function can be one vs rest or one vs one.
    • For 2 Dimensions' X data, territorial map plot is available for output.
  • Installation
    Download the file "SVM Classification.opx", and then drag-and-drop onto the Origin workspace. An icon will appear in the Apps gallery window.
  • Operation
    1. Import desired data into a worksheet.
    2. Select X columns for training, and click the icon in the Apps Gallery panel.
    3. In the pop up dialog, select one column as training Y.
    4. If you want to make prediction for another dataset, check Predict checkbox, and select the dataset.
    5. In the Options tab, change the parameters as needed for your case. For details for each parameter, see Dialog Settings below.
    6. If the training X is 2 dimensions, in the Output tab, you can select to make territorial map plot or not.
    7. Click OK button to create report.
  • Dialog Settings
    • Input Tab
      • Training X: X dataset of the samples.
      • Training Y: Y data of the samples.
      • Predict: If checked, perform prediction for the specified X dataset.
      • X to Predict: Available if Predict is checked, is to specified the X dataset for prediction.
    • Options Tab
      • Regularization Parameter: The strength of the regularization is inversely proportional to this regularization parameter. Its penalty is squred L2 penalty.
      • Kernel: Kernel type for the algorithm, including linear, poly, rbf, and sigmoid.
      • Degree: If kernel is poly, this is for specifying the degree of the polynomial kernel function.
      • Gamma: This is available when Kernel is poly, rbf or sigmoid. Default is scale.
      • Gamma Value: This is the value for specified gamma.
      • Independent Term: This is available when Kernel is poly or sigmoid, used to specify the independent term in kernel function.
      • Shrinking Heuristic: Whether to use the shrinking heuristic.
      • Estimate Probability: Whether to enable probability estimates.
      • Tolerance: Tolerance for stopping criterion.
      • Max Iterations: Max number of iterations for stopping the solver, and -1 for no limit.
      • Decision Function: Specify decision function, one vs rest or one vs one.
      • Specify Random State: Check to specify the seed of pseudo random number generator used when shuffling the data for probability estimates.
      • Random State: Specify the seed of pseudo random number generator.
    • Output Tab
      • Territorial Map: Check to output territorial map plot. This is for training X with 2 dimensions.
      • X1 Minimum: The minimum value of the first dimension of training X.
      • X1 Maximum: The maximum value of the first dimension of training X.
      • X2 Minimum: The minimum value of the second dimension of training X.
      • X2 Maximum: The maximum value of the second dimension of training X.
      • Number of Points for X1: Number of points for the first dimension of training X to make the territorial map plot.
      • Number of Points for X2: Number of points for the second dimension of training X to make the territorial map plot.
      • Report Table: The report table to output the results.
      • Report Data: The worksheet to output the report data.
    • OK: Click this button to create report.
    • Cancel: Close dialog without doing anything.
  • References
    • This app is calling sklearn.svm.SVC for the calculation, please refer to svm classification for more details.

Updates:

v2.2: K fold cross validation support
v2.1: Update to use the scikit-learn with version 1.2.1
v2: Update to check the scikit-learn library installation
v1.9: Update to use Python 3.11
v1.8: Update to use pip command to install related Python libraries
v1.7: Fix bug for categorical data as x
v1.6: Update for Python 3.8
v1.5: Fix bug for colormap of territorial map
v1.4: Update for Origin 2021
v1.3: Support data filter for group (class) column
v1.2: Fixed bug of creating territorial map issue, and auto install dependent Python packages
v1.1: Fixed speed issue of updating plot and issue of dependent Python packages

Reviews and Comments:
11/28/2024abdullahamEXCELLENT

06/19/2024807985768WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\joblib already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\joblib-1.4.2.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\numpy already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\numpy-1.24.4.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\scikit_learn-1.2.1.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\scipy already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\scipy-1.10.1-cp38-cp38-win_amd64.whl already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\scipy-1.10.1.dist-info already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\scipy.libs already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramData\OriginLab\PyPackage\Py38\64bit\sklearn already exists. Specify --upgrade to force replacement.
WARNING: Target directory C:\ProgramD

06/10/2024vtstm50r418Sorry, for posting here.
I tried to run Tutorial, and get this.
svm_n:X-Function failed to execute!
Internal error code: -898, -1
Please correct the error.

05/16/2024RuqeyI followed the instructions, but the app shows me some Python libraries that need to be installed (it is already installed) (specifically, these are `threadpoolctl` and `scipy`). Any help with this issue would be greatly appreciated.

05/13/2024RuqeyI followed the instructions, but the app shows me some Python libraries that need to be installed (it is already installed) (specifically, these are `threadpoolctl` and `scipy`). Any help with this issue would be greatly appreciated.

01/03/2024  

08/16/2023段一雄 

08/28/2022XC1119796177It would be better if some teaching vidio regarding SVM can be uploaded.

10/27/2020venyipaulThank you OriginLab