Algoritma DBSCAN dan K-Means Clustering dalam Pemilihan Saham Berdasarkan Feature Engineering

Ratna Tri Aulia, Arisman Adnan, Ihda Hasbiyati

Abstract


Stocks is one of the investment assets in the capital market that hold a particular appeal for investors. Various indexes represent the characteristics of stocks listed on the Indonesia Stock Exchange, one of which is LQ45. This stock indexes that these composite stocks are large-cap stocks with high liquidity and good fundamentals. Choosing assets for portfolio allocation is a important factor in investing, with the goal being to maximize returns and minimize risks. This study aims to classify LQ45 stocks based on specific characteristics such as volatility, liquidity, and market capitalization, extracted through feature engineering. This future are used to extract information from the data and is conducted during the data preprocessing stage. The clustering method used is the K-Means clustering algorithm with the assistance of the DBSCAN algorithm to detect outliers and the elbow method to determine the optimal number of clusters. The clustering analysis process is carried out without outlier data and using Rstudio software. Based on this study, a Silhouette Score (SC) of 0.7004 or 70.04% was obtained, indicating a strong clustering structure as the value falls within the interval of 0.7 to 1. Additionally, a total of 5 clusters were formed.


Keywords


DBSCAN, Feature engineering, K-Means clustering, Silhouette coefficient, Stock.

Full Text:

PDF

References


E. Endri, F. Fauzi, and M. S. Effendi, “Integration of the Indonesian Stock Market with Eight Major Trading Partners’ Stock Markets,” Economies, vol. 12, no. 12, pp. 1–22, 2024.

T. Febiyola, R. S. Utari, B. T. Panggabean, and R. Agustina, “Analisis Surat Berharga Sebagai Alat Investasi,” Publ. Ilmu Huk., vol. 2, no. 3, pp. 75–86, 2024.

A. F. Ridwan, H. Napitupulu, and Sukono, “Decision-making in formation of mean-VaR optimal portfolio by selecting stocks using K-means and average linkage clustering,” Decis. Sci. Lett., vol. 11, pp. 431–442, 2022.

T. Andika, I. Fahmi, and T. Andati, “the Macroeconomic Surprise Effects on Lq45 Stock Return Volatility,” J. Apl. Manaj., vol. 17, no. 2, pp. 235–243, 2019.

S. Amaroh and C. Nasichah, “Risk-Return Analysis on Optimum Portfolio Selection of Islamic Stocks,” Equilib. J. Ekon. Syariah, vol. 9, no. 1, pp. 65–82, 2021.

M. Lekovic, “Investment Diversification as a Strategy for Reducing Investment Risk,” Ekon. horizonti, vol. 20, no. 2, pp. 169–184, 2018.

A. Srimurdianti, Sukamto, W. Setiawan, E. Esyudha, and Pratama, “JEPIN (Jurnal Edukasi dan Penelitian Informatika) Data Mining untuk Pengelompokan Saham pada Sektor Energi dengan Metode K-Means,” J. Edukasi dan Penelit. Inform., vol. 9, no. 1, pp. 76–81, 2023.

S. Liu and X. Liu, “Research on Density-Based K-means Clustering Algorithm,” J. Phys. Conf. Ser., vol. 2137, no. 012071, 2021.

B. Siregar and Y. Yosia, “Implementation of K-means Clustering Algorithm for the Indonesian Stock Exchange,” J. Sisfotek Glob., vol. 14, no. 1, pp. 49–56, 2024.

A. A. N. DEVI, K. DHARMAWAN, and N. K. T. TASTRAWATI, “Pengelompokan Saham Menggunakan K-Means Dalam Pembentukan Portofolio Optimal,” E-Jurnal Mat., vol. 12, no. 4, pp. 302–308, 2023.

Z. Cebeci and F. Yildiz, “Comparison of K-Means and Fuzzy C-Means Algorithms on Different Cluster Structures,” J. Agric. Informatics, vol. 6, no. 3, pp. 13–23, 2015.

D. Wu, X. Wang, and S. Wu, “Construction of stock portfolios based on k-means clustering of continuous trend features,” Knowledge-Based Syst., vol. 252, p. 109358, 2022.

L. Gubu, E. Cahyono, H. Budiman, and M. Kabil Djafar, “Cluster Analysis for Mean-Variance Portfolio Selection: a Comparison Between K-Means and K-Medoids Clustering,” J. Ris. Ap. Mat, vol. 07, no. 02, pp. 104–115, 2023.

S. K. Kumari, P. Kumar, J. Priya, S. Surya, and A. K. Bhurjee, “Mean-value at risk portfolio selection problem using clustering technique: A case study,” AIP Conf. Proc., vol. 2112, no. 020178, 2019.

B. Aslam, R. A. Bhuiyan, and C. Zhang, “Portfolio Construction with K-Means Clustering Algorithm Based on Three Factors,” MATEC Web Conf., vol. 377, 2023.

A. Iriany, H. R. A. Putri, and H. M. Tua, “K-means Nonhierarchical Cluster and Dbscan Outlier Detection In the Grouping of Stock Issuers,” Proof, vol. 3, no. 4, pp. 21–28, 2023.

H. Firmansyah and D. Rosadi, “Construction of stock portfolios based on k-means clustering of continuous trend features,” Knowledge-Based Syst., vol. 20, no. 2, pp. 149–172, 2024.

I. Nathania and S. Sumani, “Volatility and Liquidity Comparison of Indonesian and Singapore Stock Market in COVID-19 Mobility Restrictions Era,” Binus Bus. Rev., vol. 14, no. 3, pp. 235–245, 2023.

D. Virmani, S. Taneja, and G. Malhotra, “Normalization based K means Clustering Algorithm,” Int. J. Adv. Eng. Res. Sci., vol. 2, no. 2, pp. 36–40, 2015.

H. Simanjutak, . Sawaluddin, and M. Zarlis, “Analysis of DBSCAN Algorithm in Determining Epsilon Parameters Numerical Data Clustering,” in Proceedings ofthe International Conference on Natural Resources andTechnology, 2019, pp. 220–222.

M. Fuad, E. M. S. Rochman, and A. Rachmad, “Salt Commodity Data Clustering Using Fuzzy C-Means,” J. Phys. Conf. Ser., vol. 2406, no. 1, pp. 0–9, 2022.

K. S. Pranata, A. A. S. Gunawan, and F. L. Gaol, “Development clustering system IDX company with k-means algorithm and DBSCAN based on fundamental indicator and ESG,” Procedia Comput. Sci., vol. 216, pp. 319–327, 2023.

N. A. Maori and E. Evanita, “Metode Elbow dalam Optimasi Jumlah Cluster pada K-Means Clustering,” Simetris J. Tek. Mesin, Elektro dan Ilmu Komput., vol. 14, no. 2, pp. 277–287, 2023.

P. Dziuba, D. Glukhova, and K. Shtogrin, “Risk, Return and International Portfolio Diversification: K-Means Clustering Data,” Balt. J. Econ. Stud., vol. 8, no. 3, pp. 53–64, 2022.

A. Fawaid Ridwan and S. Supian, “IDX30 Stocks Clustering with K-Means Algorithm based on Expected Return and Value at Risk,” Int. J. Quant. Res. Model., vol. 2, no. 4, pp. 201–208, 2021.




DOI: https://doi.org/10.15548/jostech.v5i1.10182

Refbacks

  • There are currently no refbacks.


Copyright (c) 2025 JOSTECH Journal of Science and Technology

Creative Commons License
This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.