Skip to content

Including hard margin svm(original space and dual space), soft margin svm. The problems were solver by cvxopt library and sklearn respectively.

Notifications You must be signed in to change notification settings

taylorlulu/svm-python-kernel

Repository files navigation

svm-python-kernel

Including hard margin svm(original space and dual space), soft margin svm. The problems were solver by cvxopt library and sklearn respectively.

The main target of this project is to realize road segmentation through svm.

Several ways were provided in the svmpy folder.

The svm_original_space.py is to solve hard margin svm in original space.

The svm_original_space.py is to solve hard margin svm in dual space.

The svm_soft_margin.py is a soft margin svm.

The svm_soft_margin.py introduce kernel function on the basis of svm_soft_margin.py.

You can test it through the svm_qp_test.jupyter or svm_sklearn_test.jupyter files.

If you use the svm_qp and svm_sklearn code, please input data through mouse, right click on the non-road area and left click on the road area.

The program will run on their own.

It should be noted that the svm_original_space may have some problems to solve linearly inseparable problems.

Some results are shown below:

Linear dual space Linear soft margin C=100 00直线分割 Linear dual space直线分割 Linear dual space曲线分割 Nonlinear soft margin C=100 00,kernel=polynomial曲线分割 Nonlinear soft margin C=100 00,kernel=poly曲线分割

About

Including hard margin svm(original space and dual space), soft margin svm. The problems were solver by cvxopt library and sklearn respectively.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published