This program manily used to amplify the existed dimension of dataset by creating new features. The main process can be divided into two parts:
This method may improve the accuracy of some models when making regression or classification. It's one small attempt, which may need further improvement.
This is the output figure which is made by 'glmnet' pakcage. The two vertical lines represent two different feature numbers. (lambda_min = 8, lambda_1se = 7).Detailed information can be viewed from ‘glmnet’ package.
1.R CRAN
install.packages('KLexp')
2.github
library(devtools)
install_github('https://github.com/Zongrui-Dai/Kernel-lasso-feature-expansion')
1.Kernel_lasso.R
It is used to construct the kernel-lasso structure and output the final features. The ‘kernel_lasso_expansion’ will return 5 results contains in one list:
List of 5
$ original :'data.frame': 182 obs. of 3 variables: ##The original dataset
$ expansion :'data.frame': 182 obs. of 9 variables: ##The amplified dataset
$ final_feature: chr [1:8] "event" "dist" "1 2" "1 3" ... ##The name of the final feature
$ final_data :'data.frame': 182 obs. of 8 variables: ##The dataset of the final feature
$ lasso :List of 12 ##The result from the cv.glmnet()
2.Standardization.R
This function is used to calculate the Z-score and max-min-scale of the dataset. The input dataset should be ‘data.frame’
I will keep updating the program if any improvement is needed. This method still needs further testing to prove whether it can improve the ability of certain models or which model will gain the most benefits.
1.The package has been updated to CRAN. If the test is passed, I will put up a link here.
Z. Dai, J. Li, T. Gong, C. Wang (2021), Kernel_lasso feature expansion method: boosting the prediction ability of machine learning in heart attack,” 2021 IEEE.
2.R CRAN
https://mirror-hk.koddos.net/CRAN/src/contrib/KLexp_1.0.0.tar.gz