{"id":2150,"date":"2023-02-23T09:24:00","date_gmt":"2023-02-23T09:24:00","guid":{"rendered":"https:\/\/www.tejwin.com\/en\/insights\/pca-feature-portfolio\/"},"modified":"2023-02-23T09:24:00","modified_gmt":"2023-02-23T09:24:00","slug":"pca-feature-portfolio","status":"publish","type":"insight","link":"https:\/\/www.tejwin.com\/en\/insights\/pca-feature-portfolio\/","title":{"rendered":"PCA Feature Portfolio"},"content":{"rendered":"<p class=\"wp-block-paragraph\" id=\"ceae\">Optimizing investment portfolios using PCA (Principal Component Analysis)<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1oAOMDP0-pDGV2U7raYe6uQ.png\"\/><figcaption class=\"wp-element-caption\">Photo by\u00a0<a href=\"https:\/\/unsplash.com\/@kmuza\" rel=\"noreferrer noopener\" target=\"_blank\">Carlos Muza<\/a>\u00a0on\u00a0<a href=\"https:\/\/unsplash.com\/s\/photos\/finance\" rel=\"noreferrer noopener\" target=\"_blank\">Unsplash<\/a><\/figcaption><\/figure>\n<h2 class=\"wp-block-heading\" id=\"b23c\">Summary of key points of this article<\/h2>\n<p class=\"wp-block-paragraph\" id=\"4c4d\">Article Difficulty\uff1a\u2605\u2605\u2605\u2605\u2606<\/p>\n<h2 class=\"wp-block-heading\" id=\"9271\">Introdution<\/h2>\n<p class=\"wp-block-paragraph\">The essence of mathematics is not to complicate simple things but to simplify complex things.\u201d \u2013 Stan Gudder<\/p>\n<p class=\"wp-block-paragraph\">Principal Component Analysis (PCA), a crucial technique in unsupervised learning, is widely used in the fields of machine learning and statistics to analyze data and reduce data dimensionality. Its core idea is to break down the original data into representative principal components, achieving dimensionality reduction and providing a new description of the data.<\/p>\n<h2 class=\"wp-block-heading\" id=\"9573\">The key points of this article<\/h2>\n<p class=\"wp-block-paragraph\">The main purpose of this study is to utilize daily stock return data, apply PCA to obtain principal components, and construct an investment portfolio. Readers of this article will see the following key points:<\/p>\n<ol class=\"wp-block-list\">\n<li>Understanding the eigenvalues and eigenvectors of PCA and using them to design an investment portfolio.<\/li>\n<li>Methods for backtesting portfolio performance, applicable to various investment strategies.<\/li>\n<\/ol>\n<h2 class=\"wp-block-heading\" id=\"abd2\">Editing Environment and Module Requirements<\/h2>\n<p class=\"wp-block-paragraph\" id=\"18a0\">This article uses Windows OS and employs Jupyter as the editor.<\/p>\n<pre class=\"wp-block-preformatted\">import tejapi<br\/>import pandas as pd<br\/>import numpy as np<br\/>import matplotlib.pyplot as plt<br\/>import seaborn as sns<br\/>from sklearn.preprocessing import StandardScaler<br\/>from sklearn.decomposition import PCA<br\/><br\/>tejapi.ApiConfig.api_key = \"Your Key\"<\/pre>\n<h2 class=\"wp-block-heading\" id=\"59a7\">Database Usage<\/h2>\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p class=\"wp-block-paragraph\">0050 Index Constituent Data Set \u2014 Listed OTC Index (TWN\/EWISAMPLE)<\/p>\n<p class=\"wp-block-paragraph\">0050 Stock price return (day) \u2013 rate of return (TWN\/APRCD2)<\/p>\n<p class=\"wp-block-paragraph\">0050 Adjustment of stock price (day) \u2014 ex-dividend adjustment (TWN\/APRCD1)<\/p>\n<\/blockquote>\n<h2 class=\"wp-block-heading\" id=\"879e\">Data Loading<\/h2>\n<p class=\"wp-block-paragraph\" id=\"2bd1\">Loading Index Data Period: 2013.01.01\u20132022.11.24 Loading 0050 Constituent Stocks with filtering based on the \u201cend_date\u201d column to select stocks that are currently part of the constituents.<\/p>\n<pre class=\"wp-block-preformatted\">mdate = {'gte':'2000-01-01', 'lte':'2022-11-24'}<br\/>data = tejapi.get('TWN\/EWISAMPLE',<br\/>                  idx_id = \"IX0002\",<br\/>                  start_date = mdate,<br\/>                          paginate=True)<br\/><br\/>data1 = data[data[\"end_date\"] &lt; \"2022-11-24\"]<br\/>diff_data = pd.concat([data,data1,data1]).drop_duplicates(keep=False)<br\/>coid = list(diff_data[\"coid\"])<br\/>print(len(coid))<br\/>diff_data<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1iexpA-FYzPaRapG9SzR-LQ.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"8a49\"><strong>0050 Loading Returns Data<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">for i in range(0,len(coid)):<br\/>    print(i)<br\/>    if i == 0:<br\/>        df = tejapi.get('TWN\/EWPRCD2',<br\/>                                  coid = coid[i],<br\/>                                  mdate = {'gte':'2013-01-01', 'lte':'2022-11-24'},<br\/>                                  paginate=True)<br\/>        df.set_index(df[\"mdate\"],inplace=True)<br\/>        Df = pd.DataFrame({coid[i]:df[\"roia\"]})<br\/>    else:<br\/>        df = tejapi.get('TWN\/EWPRCD2',<br\/>                                  coid = coid[i],<br\/>                                  mdate = {'gte':'2013-01-01', 'lte':'2022-11-24'},<br\/>                                  paginate=True)<br\/>        df.set_index(df[\"mdate\"],inplace=True)<br\/>        Df1 = pd.DataFrame({coid[i]:df[\"roia\"]})<br\/>        Df = pd.merge(Df,Df1[coid[i]],how='left', left_index=True, right_index=True)<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1btUH44re5rNlbRI5XqbsVw.png\"\/><\/figure>\n<h2 class=\"wp-block-heading\" id=\"35d7\">Data Cleaning<\/h2>\n<p class=\"wp-block-paragraph\">The return rate information of ASE Investment Holdings (3711) was only available after 2018\/04\/30 and was deleted.<br \/>Shanghai Commercial Savings Bank ( 5876 ) was listed after 2014\/09\/25 and only had rate of return information, so it was excluded.<br \/>Silicon Power-KY (6415) was listed after 2013\u201312\u201312, and the rate of return data is excluded.<\/p>\n<pre class=\"wp-block-preformatted\">del Df[\"3711\"]<br\/>del Df[\"5876\"]<br\/>del Df[\"6415\"]<\/pre>\n<p class=\"wp-block-paragraph\">Therefore, this article focuses on the 47 constituent stocks of the Taiwan 0050 Index up to 2022\/11\/24, excluding the three stocks mentioned above.<\/p>\n<h3 class=\"wp-block-heading\" id=\"42fa\">Data Visualization<\/h3>\n<p class=\"wp-block-paragraph\">First, we need to have a basic understanding of the dataset. By observing the correlations between the returns of each constituent stock, we can see a significant positive correlation among daily returns. Therefore, the data can be represented in a lower dimension, which is less than the current 47 dimensions.<\/p>\n<pre class=\"wp-block-preformatted\">cor = Df.corr()<br\/>plt.figure(figsize=(30,30))<br\/>plt.title(\"Correlation Matrix\")<br\/>sns.heatmap(cor, vmax=1,square=True,annot=True,cmap=\"cubehelix\")<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1elAvDiWlr859CKfoAaunTA.png\"\/><\/figure>\n<h3 class=\"wp-block-heading\" id=\"e656\">Data Standardization<\/h3>\n<p class=\"wp-block-paragraph\" id=\"1b82\">Before building the model, we do not know the importance of each feature in the dataset, which can lead to a significant loss of information. Therefore, standardizing each feature to have the same range of values is necessary, followed by applying PCA.<\/p>\n<pre class=\"wp-block-preformatted\">scale = StandardScaler().fit(Df)<br\/>rescale = pd.DataFrame(scale.fit_transform(Df),columns=Df.columns,index=Df.index)<br\/>#\u6a19\u6e96\u5316\u8996\u89ba\u5316<br\/>plt.figure(figsize=(20,5))<br\/>plt.title(\"2330_Return\")<br\/>rescale[\"2330\"].plot()<br\/>plt.grid=True<br\/>plt.legend()<br\/>plt.show()<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1sjZ0IqlK_SYR1XmpAJD_AQ.png\"\/><\/figure>\n<h2 class=\"wp-block-heading\" id=\"73a6\">PCA<\/h2>\n<p class=\"wp-block-paragraph\" id=\"0cb3\"><strong>Model Setup<br \/><\/strong>We aim to reduce the original 47-dimensional data to 10 dimensions, representing the original data using 10 principal components.<\/p>\n<pre class=\"wp-block-preformatted\">n_components = 10<br\/>pca = PCA(n_components=n_components)<br\/>Pc = pca.fit(X_train)<\/pre>\n<p class=\"wp-block-paragraph\" id=\"4e9e\"><strong>PCA Explaining Variables<\/strong><\/p>\n<p class=\"wp-block-paragraph\" id=\"3f66\">The first principal component represents the largest variance in the original data, the second principal component represents the second-largest variance, and so on in descending order of variance.<\/p>\n<pre class=\"wp-block-preformatted\">fig, axes = plt.subplots(ncols=2)<br\/>Series1 = pd.Series(Pc.explained_variance_ratio_[:n_components ]).sort_values()<br\/>Series2 = pd.Series(Pc.explained_variance_ratio_[:n_components ]).cumsum()<br\/><br\/>Series1.plot.barh(title=\"Explained Variance\",ax=axes[0])<br\/>Series2.plot(ylim=(0,1),ax=axes[1],title=\"Cumulative Explained Variance\")<br\/>print(\"\u8b8a\u6578\u7d2f\u7a4d\u89e3\u91cb\u6bd4\u4f8b\uff1a\")<br\/>print(Series2[len(Series2)-1:len(Series2)].values[0])<br\/>print(\"\u5404\u8b8a\u6578\u89e3\u91cb\u6bd4\u4f8b\uff1a\")<br\/>print(Series1.sort_values(ascending=False))<\/pre>\n<figure class=\"wp-block-image aligncenter caption-align-center\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1FO0XVK4rrM-Tl39pU53xCw.png\"\/><figcaption class=\"wp-element-caption\">Cumulative Explained Variance Ratio<\/figcaption><\/figure>\n<p class=\"wp-block-paragraph\">From the left chart, it can be seen that the first 10 principal components explain the variance. The first principal component alone accounts for 35% of the variance in the original data, which means it explains 35% of the daily return variations in the 47 constituent stocks. This dominant principal component is often referred to as the \u201cmarket\u201d factor.<\/p>\n<p class=\"wp-block-paragraph\">From the right chart, it can be observed that the first 10 principal components collectively explain approximately 60% of the variance in the daily returns of these 47 stocks.<\/p>\n<h2 class=\"wp-block-heading\" id=\"fd9b\"><strong>Creating an Investment Portfolio using PCA<\/strong><\/h2>\n<p class=\"wp-block-paragraph\" id=\"6c90\"><strong>Setting Portfolio Weights<br \/><\/strong>In the previous step, we examined the explained variance by the principal components. Next, we will explore the correlation of the original data, which consists of 47 stocks, with these 10 principal components. We will use this information to design the portfolio weights.<\/p>\n<pre class=\"wp-block-preformatted\">n_components = 10<br\/>weights = pd.DataFrame()<br\/>for i in range(n_components):<br\/>    weights[\"weights_{}\".format(i)] = pca.components_[i] \/ sum(pca.components_[i])<br\/>weights = weights.values.T<br\/>weight_port = pd.DataFrame(weights,columns=Df.columns)<br\/>weight_port.index = [f'Portfolio{i}' for i in range(weight_port.shape[0])]<br\/>weight_port<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/11srkuYE91zk9YuGVJqOXJQ.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"f217\"><strong>Explaining the Portfolio Weighting Method<br \/><\/strong>The first principal component explains 35% of the variance. Let\u2019s examine the correlation of each variable (47 constituent stocks) with the first principal component.<\/p>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1QDWSGYYcfUoXOR33qj-QyA.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"d340\">As seen from the array, the correlation of all 47 constituent stocks with the first principal component is in the same direction (all negative), and the differences in magnitude are not significant. This further validates our previous explanation that the first principal component represents the \u201cmarket\u201d factor.<\/p>\n<pre class=\"wp-block-preformatted\">weight_port.iloc[0].T.sort_values(ascending=False).plot.bar(subplots=True,figsize=(20,5),<br\/>                          legend=False,sharey=True,ylim=(-0.75,0.75))<\/pre>\n<p class=\"wp-block-paragraph\" id=\"6cd3\">Next, we calculate the portfolio weights by taking the correlation of each stock divided by the sum of correlations of all stocks.<\/p>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1ktoEdEOTfxR-vdXFLwZuhg.png\"\/><\/figure>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1xJ41g0iR-uU8CAh3D16mlw.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"a0a8\"><strong>Plotting the Weights of the Top Five Principal Components in the Portfolio<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">weight_port[:5].T.plot.bar(subplots=True,layout = (int(5),1),figsize=(20,25),<br\/>                      legend=False,sharey=True,ylim=(-2,2))<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1_z7C5kw5l92eekTiIvw7FQ.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"d5b7\"><strong>Examining the Classification Logic of Other Principal Components<\/strong><\/p>\n<p class=\"wp-block-paragraph\" id=\"995c\">Portfolio 1<\/p>\n<p class=\"wp-block-paragraph\" id=\"531f\">The top three are Nanya Branch (2408), Yageo (2327), and Airtec KY (1590); the last three are Far EasTone (4904), Taiwan University (3045), and Chunghwa Electronics (2412). Out of Portfolio 1, the weighting of electronic stocks is higher, while the weighting of transmission and telecommunications stocks is lower.<\/p>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1VsJy8gQHh27CF6x0goNUpA.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"5b91\">Portfolio 2<\/p>\n<p class=\"wp-block-paragraph\" id=\"4d5b\">The top three stocks in Portfolio 2 are actually the three major telecommunications companies, while the later stocks are mostly from the financial sector. This suggests that Portfolio 2 is a non-financial investment portfolio.<\/p>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1bc5RRns1gAXEyts_4-tMLA.png\"\/><\/figure>\n<h2 class=\"wp-block-heading\" id=\"a798\">Searching for the Optimal PCA Portfolio<\/h2>\n<p class=\"wp-block-paragraph\">We are using the Sharpe Ratio as our metric, which is a crucial indicator for measuring the performance and stability of an investment portfolio in fund investment or asset allocation. It represents \u201chow much return can be obtained while enduring 1% of risk?\u201d<\/p>\n<p class=\"wp-block-paragraph\">In this article, the Sharpe Ratio is calculated as follows: <\/p>\n<p class=\"wp-block-paragraph\"><strong>Sharpe Ratio = Annualized Return \/ Annualized Risk<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">def sharpe_ratio(ts_returns):<br\/>    ts_returns = ts_returns<br\/>    days = ts_returns.shape[0]<br\/>    n_years = days\/252<br\/>    if ts_returns.cumsum()[-1] &lt; 0:  <br\/>        annualized_return = (np.power(1+abs(ts_returns.cumsum()[-1])*0.01,1\/n_years)-1)*(-1)<br\/>    else:<br\/>        annualized_return = np.power(1+abs(ts_returns.cumsum()[-1])*0.01,1\/n_years)-1<br\/>    annualized_vol = (ts_returns*0.01).std()*np.sqrt(252)<br\/>    annualized_sharpe = annualized_return \/ annualized_vol<br\/>    <br\/>    return annualized_return,annualized_vol,annualized_sharpe<\/pre>\n<p class=\"wp-block-paragraph\" id=\"aab4\"><strong>\u9078\u51faTop5 Portfolio<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">n_components = 10\nannualized_ret = np.array([0.]*n_components)\nsharpe_metric = np.array([0.]*n_components)\nannualized_vol = np.array([0.]*n_components)\ncoids = X_train.columns.values\nn_coids = len(coids)\n\npca = PCA(n_components=n_components)\nPc = pca.fit(X_train)\npcs = pca.components_\nfor i in range(n_components):\n    pc_w = pcs[i] \/ sum(pcs[i])\n    eigen_port = pd.DataFrame(data={\"weights\":pc_w.squeeze()},index=coids)\n    eigen_port.sort_values(by=[\"weights\"],ascending=False,inplace=True)\n    #The daily portfolio return is obtained by taking the dot product of the portfolio weights and the daily returns of each constituent stock.\n    eigen_port_returns = np.dot(X_train.loc[:,eigen_port.index],eigen_port[\"weights\"])\n    eigen_port_returns = pd.Series(eigen_port_returns.squeeze(),\n                                   index = X_train.index)\n    \n    ar,vol,sharpe = sharpe_ratio(eigen_port_returns)\n    \n    annualized_ret[i] = ar\n    annualized_vol[i] = vol\n    sharpe_metric[i] = sharpe\n\nsharpe_metric = np.nan_to_num(sharpe_metric)\n\nN=5\nresult = pd.DataFrame({\"Annual Return\":annualized_ret,\"Vol\":annualized_vol,\"Sharpe\":sharpe_metric})\nresult.dropna(inplace=True)\n#Sharpe Ratio of PCA portfolio\nax = result[:N][\"Sharpe\"].plot(linewidth=3,xticks=range(0,N,1))\nax.set_ylabel(\"Sharpe\")\nresult.sort_values(by=[\"Sharpe\"],ascending=False,inplace=True)\nprint(result[:N])<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/12AdUdd-BoQxEOvfxEQPfFA.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"b2ad\">Drawing a Trend Chart of Portfolio Returns Over the Investment Period<\/p>\n<pre class=\"wp-block-preformatted\">def Backtest(i,data):<br\/>    pca = PCA()<br\/>    Pc = pca.fit(data)<br\/>    pcs = pca.components_<br\/>    pc_w = pcs[i] \/ sum(pcs[i])<br\/>    eigen_port = pd.DataFrame(data={\"weights\":pc_w.squeeze()},index=coids)<br\/>    eigen_port.sort_values(by=[\"weights\"],ascending=False,inplace=True)<br\/>    #\u6b0a\u91cd\u8207\u6bcf\u5929\u5831\u916c\u53d6\u5167\u7a4d\u5f97\u51fa\u6bcf\u65e5\u6295\u8cc7\u7d44\u5408\u5831\u916c<br\/>    eigen_port_returns = np.dot(data.loc[:,eigen_port.index],eigen_port[\"weights\"])<br\/>    eigen_port_returns = pd.Series(eigen_port_returns.squeeze(),<br\/>                                   index = data.index)<br\/>    <br\/>    ar,vol,sharpe = sharpe_ratio(eigen_port_returns)<br\/>    return eigen_port_returns,ar,vol,sharpe<\/pre>\n<p class=\"wp-block-paragraph\" id=\"23d9\"><strong>Visualizing the Trend of Portfolio Returns<\/strong><\/p>\n<pre class=\"wp-block-preformatted\">def Weight_plot(i):<br\/>    top_port = weight_port.iloc[[i]].T<br\/>    port_name = top_port.columns.values.tolist()<br\/>    top_port.sort_values(by=port_name,ascending=False,inplace=True)<br\/>    ax = top_port.plot(title = port_name[0],xticks=range(0,len(coids),1),<br\/>                  figsize=(15,6),<br\/>                  rot=45,linewidth=3)<br\/>    ax.set_ylabel(\"Portfolio Weight\")<\/pre>\n<pre class=\"wp-block-preformatted\">portfolio = 0<br\/>train_returns,train_ar,train_vol,train_sharpe = Backtest(portfolio,X_train)<br\/>ax = train_returns.cumsum().plot(rot=45)<br\/>ax.set_ylabel(\"Accumulated Return(%)\")<br\/>Weight_plot(portfolio)<\/pre>\n<figure class=\"wp-block-image aligncenter\"><img decoding=\"async\" alt=\"\" src=\"https:\/\/www.tejwin.com\/en\/wp-content\/uploads\/2026\/08\/1a18i7raBXUAJ0eDnRbQ8EA.png\"\/><\/figure>\n<p class=\"wp-block-paragraph\" id=\"b7ba\"><strong>Summary<\/strong><\/p>\n<p class=\"wp-block-paragraph\">The provided backtesting method for the portfolio constructed using PCA shows that its performance is not favorable. This outcome was somewhat expected since PCA is primarily used for portfolio classification based on return correlations and does not guarantee good returns on its own.<\/p>\n<p class=\"wp-block-paragraph\">This article provided an analysis of the Taiwan 50 Index (with three stocks excluded due to data availability) using PCA. It reduced the original 47 stocks to 10 principal components and constructed portfolio weights based on the correlation between the principal components and individual stocks. The article discussed each principal component, highlighting the presence of the dominant \u201cmarket\u201d factor and the logical classification ability of PCA. However, providing a detailed interpretation of the meaning of each principal component can be challenging.<\/p>\n<p class=\"wp-block-paragraph\">In conclusion, it\u2019s important to reiterate that t<strong>he assets mentioned in this article are for illustrative purposes only and do not constitute any recommendations or advice on financial products. <\/strong>Therefore, readers interested in strategy development, performance testing, empirical research, and related topics are welcome to explore solutions available in the <a href=\"https:\/\/eshop.tej.com.tw\/E-Shop\/index\" rel=\"noreferrer noopener\" target=\"_blank\">TEJ E Shop<\/a>, which offers comprehensive databases for conducting various analyses and tests.<\/p>\n<h2 class=\"wp-block-heading\" id=\"e4b6\">Full Code<\/h2>\n<ul class=\"wp-block-list\">\n<li><a class=\"ek-link\" href=\"https:\/\/gist.github.com\/tej87681088\/a9a9aeda9ad707d542ec667d4f916ee2#file-tejapi_python_pca-py\" rel=\"noopener\" target=\"_blank\">Click here to go<\/a><a class=\"ek-link\" href=\"https:\/\/gist.github.com\/tej87681088\/a9a9aeda9ad707d542ec667d4f916ee2#file-tejapi_python_pca-py\" rel=\"noopener\" target=\"_blank\">Github<\/a><\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"9241\">Further Reading<\/h2>\n<ul class=\"wp-block-list\">\n<li><a class=\"ek-link\" href=\"https:\/\/medium.com\/tej-api-%E9%87%91%E8%9E%8D%E8%B3%87%E6%96%99%E5%88%86%E6%9E%90\/%E9%87%8F%E5%8C%96%E5%88%86%E6%9E%90-%E7%B1%8C%E7%A2%BC%E9%9B%86%E4%B8%AD%E5%BA%A6-b01c9d4b0593\" rel=\"noopener\" target=\"_blank\">Chip Concentration<\/a><\/li>\n<li><a class=\"ek-link\" href=\"https:\/\/www.tejwin.com\/insight\/%e3%80%90%e5%af%a6%e6%88%b0%e6%87%89%e7%94%a8%e3%80%91%e7%be%8a%e7%be%a4%e6%8c%87%e6%a8%99%e6%87%89%e7%94%a8\/\">Herd Indicator Application<\/a><\/li>\n<\/ul>\n<h2 class=\"wp-block-heading\" id=\"69fb\">Related Link<\/h2>\n<ul class=\"wp-block-list\">\n<li><a class=\"ek-link\" href=\"https:\/\/api.tej.com.tw\/index.html\" rel=\"noopener\" target=\"_blank\">TEJ API\u00a0Database Home Page<\/a><\/li>\n<li><a class=\"ek-link\" href=\"https:\/\/eshop.tej.com.tw\/E-Shop\/Edata_intro\" rel=\"noopener\" target=\"_blank\">TEJ E-Shop Complete Database Purchase<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Principal Component Analysis (PCA) is a key technique in unsupervised learning widely used in machine learning and statistics to analyze data and reduce data dimensionality. Its core idea is to break down the original data into representative principal components, achieving dimensionality reduction and providing a new description of the data.<\/p>\n","protected":false},"featured_media":2149,"template":"","tags":[52,91,97],"insight_category":[16],"class_list":["post-2150","insight","type-insight","status-publish","has-post-thumbnail","hentry","tag-quantitative-analysis","tag-beginners-guide","tag-data-analysis","insight_category-quant-data-science"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight\/2150","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight"}],"about":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/types\/insight"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media\/2149"}],"wp:attachment":[{"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/media?parent=2150"}],"wp:term":[{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/tags?post=2150"},{"taxonomy":"insight_category","embeddable":true,"href":"https:\/\/www.tejwin.com\/en\/wp-json\/wp\/v2\/insight_category?post=2150"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}