A simple implementation of Adaptive Feature-Space Conformal Transformationfor any kernel SVM proposed in [2]
In [1], the idea of inceasing the separability (margin) of classes for kernel SVM, can be achieved by magnify the spatial resolution in the region around the boundary in the hyperspace, the non-linear serface where
Given
to enlarge the distance near the boundary in non-linear surface in higher dimension by choosing appropriate
In [1], it has been suggested that
where
where
In this implementation, we use the
where
Note that given kernel function,
Dealing with Imbalaned
It has been stated in [2] that the
installation
pip install afc-svm-imbalanced-learning
Usage
from afc_imbalanced_learning import AFSCTSvm
afc_svm = AFSCTSvm()
afc_svm.fit(X_train, y_train)
y_pred = afc_svm.predict(X_test)
what .fit(X_train, y_train)
does is it train kernel svm with laplacian kernel .predict
is called.
Custom initial kernel
you can use your own custom kernel function by parse it to kernel parameter
from sklearn.metrics.pairwise import rbf_kernel
afc_svm = AFSCTSvm(kernel=rbf_kernel)
afc_svm.fit(X_train, y_train)
Note that in this implementation, cost-sensitive svm will be used by default
[1]
Wu, Si and Shun‐ichi Amari. “Conformal Transformation of Kernel Functions: A Data-Dependent Way to Improve Support Vector Machine Classifiers.” Neural Processing Letters 15 (2002): 59-67.
[2]
Wu, Gang & Chang, Edward. (2003). Adaptive Feature-Space Conformal Transformation for Imbalanced-Data Learning. Proceedings, Twentieth International Conference on Machine Learning. 2. 816-823.