Fundamentals 9 min read

How PCA Transforms Supplier Evaluation with Weighted Scores

This article explains the Principal Component Analysis (PCA) method, outlines its step‑by‑step weighting algorithm, and demonstrates a complete Python implementation that converts supplier metrics into objective scores using scikit‑learn.

Model Perspective
Model Perspective
Model Perspective
How PCA Transforms Supplier Evaluation with Weighted Scores

Principal Component Analysis (PCA) is a multivariate statistical method that reduces dimensionality by converting multiple correlated indicators into a few uncorrelated composite indicators called principal components.

PCA determines weights based on the data’s own correlation, transforming the original variables into independent ones through linear transformation.

When many evaluation metrics are correlated, PCA helps avoid subjective bias and overlapping information, making the evaluation system more objective.

The first principal component captures the largest variance; subsequent components capture remaining variance under the constraint of zero covariance with previous components.

PCA Weighting Algorithm Steps

Standardize (or centralize) the original indicator matrix and compute its covariance matrix.

Obtain eigenvalues and eigenvectors, and orthogonalize the eigenvectors.

Select principal components based on variance contribution rate (e.g., cumulative contribution > 0.89) or criteria such as eigenvalue > 1.

Calculate the coefficients of each indicator in the selected principal components.

Compute weights by averaging the variance contribution rates of the chosen components and normalizing.

Implementation

The weighting process consists of two stages: performing PCA and then calculating weights from its results. The example uses Python’s scikit-learn library on a dataset of 100 suppliers (first ten rows shown).

<code># import packages
import pandas as pd
from sklearn.decomposition import PCA

# prepare data and fit model
data = pd.read_excel('load_supplier.xlsx', index_col=0)
pca = PCA()
pca.fit(data)

# show results
n_feature = len(data.columns)
col_names = ['X' + str(i) for i in range(1, n_feature + 1)]
index_names = ['F' + str(i) for i in range(1, n_feature + 1)]
comps = pd.DataFrame(pca.components_, index=index_names, columns=col_names)
</code>

The resulting component matrix and explained variance are displayed, showing that the first six components explain about 89% of the variance.

<code>print('解释方差:', pca.explained_variance_)
print('解释方差占比:', pca.explained_variance_ratio_)
</code>

A plot of the explained variance ratio and its cumulative sum indicates that six components are sufficient. The model is rerun with n_components=6 :

<code># prepare data and fit model
data = pd.read_excel('load_supplier.xlsx', index_col=0)
n_components = 6
pca = PCA(n_components=n_components)
pca.fit(data)

# show results
n_feature = len(data.columns)
col_names = ['X' + str(i) for i in range(1, n_feature + 1)]
index_names = ['F' + str(i) for i in range(1, n_components + 1)]
comps = pd.DataFrame(pca.components_, index=index_names, columns=col_names)

print('解释方差:', pca.explained_variance_)
print('解释方差占比:', pca.explained_variance_ratio_)
</code>

Weights are derived from the normalized explained variance ratios:

<code>weights = pca.explained_variance_ratio_ / pca.explained_variance_ratio_.sum()
</code>

The original data are transformed to principal component scores and multiplied by the weights to obtain a final score for each supplier:

<code>data_trans = pca.transform(data)
data1 = data.copy()
data1['score'] = data_trans @ weights
</code>

Figure images illustrate the explained variance plot and the weight distribution.

Thus the complete modeling process for supplier evaluation using PCA weighting is demonstrated.

pythondata analysisPCAscikit-learndimensionality reductionsupplier evaluationweighting algorithm
Model Perspective
Written by

Model Perspective

Insights, knowledge, and enjoyment from a mathematical modeling researcher and educator. Hosted by Haihua Wang, a modeling instructor and author of "Clever Use of Chat for Mathematical Modeling", "Modeling: The Mathematics of Thinking", "Mathematical Modeling Practice: A Hands‑On Guide to Competitions", and co‑author of "Mathematical Modeling: Teaching Design and Cases".

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.