Multiple factor analysis
Table of contents
Resources
- Multiple Factor Analysis by Hervé Abdi
- Multiple Factor Analysis: main features and application to sensory data by Jérôme Pagès
- Wikipedia article
Data
Multiple factor analysis (MFA) is designed for datasets where variables are organized into groups. A common situation is when the same individuals are described by several sets of variables — for example, the same wines rated by different expert panels, the same patients measured with different medical instruments, or the same geographical sites described by both flora and soil characteristics.
The problem with running a plain PCA on all variables at once is that larger groups dominate the analysis simply through sheer numbers, not because they carry more meaningful information. If flora is described by 50 variables and soil by 11, PCA will be influenced mainly by the flora group. MFA solves this by weighting each group so that no single group can dominate the first principal component.
The following dataset contains end of season figures for Premier League football teams. It spans the 2021/22, 2022/23, and 2023/24 seasons. Each season forms a natural group of variables. Only the 14 teams that have been in the Premier League for all three seasons are included.
import prince
dataset = prince.datasets.load_premier_league()
dataset
| 2021-22 | 2022-23 | 2023-24 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| W | D | L | GF | GA | Pts | W | D | L | GF | GA | Pts | W | D | L | GF | GA | Pts | |
| Team | ||||||||||||||||||
| Arsenal | 22 | 3 | 13 | 61 | 48 | 69 | 26 | 6 | 6 | 88 | 43 | 84 | 28 | 5 | 5 | 91 | 29 | 89 |
| Aston Villa | 13 | 6 | 19 | 52 | 54 | 45 | 18 | 7 | 13 | 51 | 46 | 61 | 20 | 8 | 10 | 76 | 61 | 68 |
| Brentford | 13 | 7 | 18 | 48 | 56 | 46 | 15 | 14 | 9 | 58 | 46 | 59 | 10 | 9 | 19 | 56 | 65 | 39 |
| Brighton & Hove Albion | 12 | 15 | 11 | 42 | 44 | 51 | 18 | 8 | 12 | 72 | 53 | 62 | 12 | 12 | 14 | 55 | 62 | 48 |
| Chelsea | 21 | 11 | 6 | 76 | 33 | 74 | 11 | 11 | 16 | 38 | 47 | 44 | 18 | 9 | 11 | 77 | 63 | 63 |
| Crystal Palace | 11 | 15 | 12 | 50 | 46 | 48 | 11 | 12 | 15 | 40 | 49 | 45 | 13 | 10 | 15 | 57 | 58 | 49 |
| Everton | 11 | 6 | 21 | 43 | 66 | 39 | 8 | 12 | 18 | 34 | 57 | 36 | 13 | 9 | 16 | 40 | 51 | 40 |
| Liverpool | 28 | 8 | 2 | 94 | 26 | 92 | 19 | 10 | 9 | 75 | 47 | 67 | 24 | 10 | 4 | 86 | 41 | 82 |
| Manchester City | 29 | 6 | 3 | 99 | 26 | 93 | 28 | 5 | 5 | 94 | 33 | 89 | 28 | 7 | 3 | 96 | 34 | 91 |
| Manchester United | 16 | 10 | 12 | 57 | 57 | 58 | 23 | 6 | 9 | 58 | 43 | 75 | 18 | 6 | 14 | 57 | 58 | 60 |
| Newcastle United | 13 | 10 | 15 | 44 | 62 | 49 | 19 | 14 | 5 | 68 | 33 | 71 | 18 | 6 | 14 | 85 | 62 | 60 |
| Tottenham Hotspur | 22 | 5 | 11 | 69 | 40 | 71 | 18 | 6 | 14 | 70 | 63 | 60 | 20 | 6 | 12 | 74 | 61 | 66 |
| West Ham United | 16 | 8 | 14 | 60 | 51 | 56 | 11 | 7 | 20 | 42 | 55 | 40 | 14 | 10 | 14 | 60 | 74 | 52 |
| Wolverhampton Wanderers | 15 | 6 | 17 | 38 | 43 | 51 | 11 | 8 | 19 | 31 | 58 | 41 | 13 | 7 | 18 | 50 | 65 | 46 |
import pandas as pd
isinstance(dataset.columns, pd.MultiIndex)
True
Fitting
Under the hood, MFA proceeds in two stages:
- Separate PCAs: a PCA is fitted independently on each group of variables.
- Weighted global PCA: all variables are concatenated, but each variable in group j is divided by the first singular value of group j’s separate PCA. This ensures that the maximum axial inertia of every group is normalized to 1, so no single group can monopolize the first axis of the global analysis.
The result is a compromise: the global components reflect the common structure shared across groups, rather than the structure of whichever group happens to have the most variables or the highest variance.
The groups are specified by the groups argument when calling fit.
groups = dataset.columns.levels[0].tolist()
groups
['2021-22', '2022-23', '2023-24']
mfa = prince.MFA(
n_components=3,
n_iter=3,
rescale_with_mean=True,
rescale_with_std=True,
copy=True,
check_input=True,
engine='sklearn',
random_state=42
)
mfa = mfa.fit(
dataset,
groups=groups,
supplementary_groups=None
)
There are several ways to specify the groups:
- If the columns of the dataframe are a
MultiIndex:- By default the groups are all the columns in the first level.
- You can also pass a list with a subset of the columns in the first level.
- You can also pass a dict that maps group names to the desired columns.
The supplementary_groups argument is expected to be a list with one more existing group names.
The rescale_with_mean and rescale_with_std parameters control whether centering and standardization are applied. These are passed to both the partial PCAs (one per group) and the global PCA.
Eigenvalues
As with PCA, eigenvalues indicate how much variance (inertia) each component captures. The first component represents the direction of maximum consensus across all groups.
mfa.eigenvalues_summary
| eigenvalue | % of variance | % of variance (cumulative) | |
|---|---|---|---|
| component | |||
| 0 | 2.376 | 59.53% | 59.53% |
| 1 | 0.619 | 15.51% | 75.04% |
| 2 | 0.412 | 10.32% | 85.36% |
Row coordinates
Row coordinates position each individual (here, each football team) in the space defined by the MFA components. Teams with similar performance profiles across all three seasons will be close together.
The MFA inherits from the PCA class, which means it provides access to the PCA methods and properties. For instance, the row_coordinates method will return the global coordinates of each team.
mfa.row_coordinates(dataset)
| component | 0 | 1 | 2 |
|---|---|---|---|
| Team | |||
| Arsenal | 2.236971 | 1.034584 | 0.697651 |
| Aston Villa | -0.179988 | 0.580297 | 0.463962 |
| Brentford | -1.267447 | 0.696757 | -0.490607 |
| Brighton & Hove Albion | -0.800062 | -0.248918 | -0.904603 |
| Chelsea | 0.000108 | -1.253858 | -0.365442 |
| Crystal Palace | -1.325908 | -0.410853 | -0.809261 |
| Everton | -2.089219 | 0.184291 | 0.552330 |
| Liverpool | 2.063236 | -1.170222 | -0.419547 |
| Manchester City | 3.393773 | -0.160572 | -0.151160 |
| Manchester United | 0.189448 | 0.753614 | -0.007898 |
| Newcastle United | -0.004656 | 1.462421 | -0.872403 |
| Tottenham Hotspur | 0.510562 | -0.416955 | 0.992128 |
| West Ham United | -1.186842 | -0.756359 | 0.432273 |
| Wolverhampton Wanderers | -1.539976 | -0.294226 | 0.882576 |
Partial row coordinates
A key feature of MFA is the concept of partial individuals. Each team can be viewed from the perspective of a single season: its “partial point” for 2021-22 shows where that team would sit if only the 2021-22 variables mattered. The global coordinate is the barycenter (average) of the partial points across groups.
When a team’s partial points cluster tightly together, it means the team had a consistent profile across all three seasons. When they spread apart, the team’s performance changed significantly from one season to another.
mfa.partial_row_coordinates(dataset)
| 2021-22 | 2022-23 | 2023-24 | |||||||
|---|---|---|---|---|---|---|---|---|---|
| 0 | 1 | 2 | 0 | 1 | 2 | 0 | 1 | 2 | |
| Team | |||||||||
| Arsenal | 0.690262 | -0.059517 | 1.417084 | 2.505624 | 2.235689 | -0.825430 | 3.515025 | 0.927579 | 1.501298 |
| Aston Villa | -1.204890 | 1.807432 | 0.898128 | 0.113710 | -0.035078 | 0.371064 | 0.551216 | -0.031464 | 0.122694 |
| Brentford | -1.289455 | 1.825781 | 0.620325 | -0.244223 | 0.442700 | -1.365260 | -2.268664 | -0.178208 | -0.726887 |
| Brighton & Hove Albion | -1.025328 | 0.230789 | -1.805521 | 0.329520 | 0.029076 | 0.362772 | -1.704379 | -1.006619 | -1.271060 |
| Chelsea | 1.423732 | -2.259632 | -1.063349 | -1.506446 | -1.230628 | 0.235333 | 0.083038 | -0.271314 | -0.268308 |
| Crystal Palace | -1.106248 | 0.364282 | -1.768677 | -1.512225 | -1.148029 | 0.057866 | -1.359252 | -0.448812 | -0.716972 |
| Everton | -2.025459 | 3.013837 | 1.068040 | -2.466096 | -2.297007 | 1.002036 | -1.776102 | -0.163958 | -0.413086 |
| Liverpool | 3.136063 | -3.954644 | -0.494832 | 0.796027 | 0.895556 | -0.763894 | 2.257618 | -0.451578 | 0.000085 |
| Manchester City | 3.346269 | -3.936828 | 0.058294 | 3.304854 | 3.094441 | -1.486358 | 3.530198 | 0.360672 | 0.974585 |
| Manchester United | -0.462376 | 0.551069 | -0.388186 | 1.322063 | 1.191180 | -0.205701 | -0.291344 | 0.518593 | 0.570194 |
| Newcastle United | -1.390156 | 1.706830 | -0.225816 | 1.136187 | 2.110547 | -2.794385 | 0.240001 | 0.569887 | 0.402993 |
| Tottenham Hotspur | 1.098053 | -0.964328 | 0.751364 | -0.037297 | -0.787417 | 1.621485 | 0.470930 | 0.500881 | 0.603535 |
| West Ham United | -0.343711 | 0.524201 | 0.161269 | -1.726248 | -2.191590 | 1.896491 | -1.490567 | -0.601689 | -0.760941 |
| Wolverhampton Wanderers | -0.846757 | 1.150731 | 0.771878 | -2.015449 | -2.309439 | 1.893981 | -1.757721 | 0.276030 | -0.018129 |
Visualization
mfa.plot(
dataset,
x_component=0,
y_component=1
)
The show_partial_rows argument allows showing the global row coordinates together with the partial row coordinates. Each team’s partial points are connected to its global point with edges. Teams whose edges are short had a stable profile across seasons; teams with long edges changed substantially.
mfa.plot(
dataset,
show_partial_rows=True
)
Separate PCAs
Before building the global analysis, MFA fits a separate PCA on each group. These are stored in the MFA object and can be inspected individually. The first eigenvalue of each group PCA is what determines the weighting: each variable in a group is divided by that group’s first singular value.
For example, here is the 2022-23 season data and its separate PCA eigenvalues:
dataset['2022-23']
| W | D | L | GF | GA | Pts | |
|---|---|---|---|---|---|---|
| Team | ||||||
| Arsenal | 26 | 6 | 6 | 88 | 43 | 84 |
| Aston Villa | 18 | 7 | 13 | 51 | 46 | 61 |
| Brentford | 15 | 14 | 9 | 58 | 46 | 59 |
| Brighton & Hove Albion | 18 | 8 | 12 | 72 | 53 | 62 |
| Chelsea | 11 | 11 | 16 | 38 | 47 | 44 |
| Crystal Palace | 11 | 12 | 15 | 40 | 49 | 45 |
| Everton | 8 | 12 | 18 | 34 | 57 | 36 |
| Liverpool | 19 | 10 | 9 | 75 | 47 | 67 |
| Manchester City | 28 | 5 | 5 | 94 | 33 | 89 |
| Manchester United | 23 | 6 | 9 | 58 | 43 | 75 |
| Newcastle United | 19 | 14 | 5 | 68 | 33 | 71 |
| Tottenham Hotspur | 18 | 6 | 14 | 70 | 63 | 60 |
| West Ham United | 11 | 7 | 20 | 42 | 55 | 40 |
| Wolverhampton Wanderers | 11 | 8 | 19 | 31 | 58 | 41 |
mfa['2022-23'].eigenvalues_summary
| eigenvalue | % of variance | % of variance (cumulative) | |
|---|---|---|---|
| component | |||
| 0 | 4.374 | 72.89% | 72.89% |
| 1 | 1.245 | 20.74% | 93.64% |
| 2 | 0.320 | 5.34% | 98.97% |
Column coordinates
Column coordinates show how each variable loads onto the global MFA components. Since MFA normalizes each group’s influence, these loadings reflect the balanced structure across groups rather than being dominated by whichever group has the most variables.
mfa.column_coordinates_
| component | 0 | 1 | 2 |
|---|---|---|---|
| variable | |||
| (2021-22, W) | 0.881990 | -0.379416 | 0.152508 |
| (2021-22, D) | -0.339390 | -0.243071 | -0.789014 |
| (2021-22, L) | -0.729856 | 0.557314 | 0.330582 |
| (2021-22, GF) | 0.817458 | -0.474511 | -0.028325 |
| (2021-22, GA) | -0.628169 | 0.702354 | 0.081710 |
| (2021-22, Pts) | 0.868301 | -0.454356 | -0.001584 |
| (2022-23, W) | 0.856058 | 0.401114 | -0.043721 |
| (2022-23, D) | -0.492092 | 0.116892 | -0.554631 |
| (2022-23, L) | -0.715459 | -0.546848 | 0.389624 |
| (2022-23, GF) | 0.849315 | 0.260247 | -0.152257 |
| (2022-23, GA) | -0.563610 | -0.465016 | 0.517534 |
| (2022-23, Pts) | 0.839579 | 0.458098 | -0.150842 |
| (2023-24, W) | 0.946929 | 0.058592 | 0.206938 |
| (2023-24, D) | -0.411948 | -0.569731 | -0.486639 |
| (2023-24, L) | -0.927339 | 0.163900 | -0.041400 |
| (2023-24, GF) | 0.893837 | 0.061729 | -0.083240 |
| (2023-24, GA) | -0.780522 | -0.130760 | -0.074441 |
| (2023-24, Pts) | 0.964985 | -0.016546 | 0.123008 |
Contributions
Contributions indicate how much each row or column contributes to the variance of each component. They sum to 1 across all rows (or all columns) for each component.
mfa.row_contributions_.style.format('{:.0%}')
| component | 0 | 1 | 2 |
|---|---|---|---|
| Team | |||
| Arsenal | 15% | 12% | 8% |
| Aston Villa | 0% | 4% | 4% |
| Brentford | 5% | 6% | 4% |
| Brighton & Hove Albion | 2% | 1% | 14% |
| Chelsea | 0% | 18% | 2% |
| Crystal Palace | 5% | 2% | 11% |
| Everton | 13% | 0% | 5% |
| Liverpool | 13% | 16% | 3% |
| Manchester City | 35% | 0% | 0% |
| Manchester United | 0% | 7% | 0% |
| Newcastle United | 0% | 25% | 13% |
| Tottenham Hotspur | 1% | 2% | 17% |
| West Ham United | 4% | 7% | 3% |
| Wolverhampton Wanderers | 7% | 1% | 14% |
mfa.column_contributions_.style.format('{:.0%}')
| component | 0 | 1 | 2 |
|---|---|---|---|
| variable | |||
| ('2021-22', 'W') | 7% | 5% | 1% |
| ('2021-22', 'D') | 1% | 2% | 33% |
| ('2021-22', 'L') | 5% | 11% | 6% |
| ('2021-22', 'GF') | 6% | 8% | 0% |
| ('2021-22', 'GA') | 4% | 18% | 0% |
| ('2021-22', 'Pts') | 7% | 7% | 0% |
| ('2022-23', 'W') | 7% | 6% | 0% |
| ('2022-23', 'D') | 2% | 1% | 17% |
| ('2022-23', 'L') | 5% | 11% | 8% |
| ('2022-23', 'GF') | 7% | 3% | 1% |
| ('2022-23', 'GA') | 3% | 8% | 15% |
| ('2022-23', 'Pts') | 7% | 8% | 1% |
| ('2023-24', 'W') | 8% | 0% | 2% |
| ('2023-24', 'D') | 2% | 11% | 12% |
| ('2023-24', 'L') | 8% | 1% | 0% |
| ('2023-24', 'GF') | 7% | 0% | 0% |
| ('2023-24', 'GA') | 6% | 1% | 0% |
| ('2023-24', 'Pts') | 8% | 0% | 1% |
Cosine similarities
Cosine similarities (cos²) measure the quality of representation of each row or column on each component. A high cos² means that the component faithfully represents that individual or variable; a low cos² means the individual’s position on that component is unreliable.
mfa.row_cosine_similarities(dataset)
| 0 | 1 | 2 | |
|---|---|---|---|
| Team | |||
| Arsenal | 7.310324e-01 | 0.156368 | 0.071104 |
| Aston Villa | 2.699398e-02 | 0.280595 | 0.179368 |
| Brentford | 5.234111e-01 | 0.158178 | 0.078424 |
| Brighton & Hove Albion | 2.145100e-01 | 0.020764 | 0.274231 |
| Chelsea | 5.150712e-09 | 0.691377 | 0.058729 |
| Crystal Palace | 6.126493e-01 | 0.058825 | 0.228225 |
| Everton | 7.817237e-01 | 0.006083 | 0.054636 |
| Liverpool | 6.925223e-01 | 0.222778 | 0.028635 |
| Manchester City | 9.804235e-01 | 0.002195 | 0.001945 |
| Manchester United | 2.364993e-02 | 0.374239 | 0.000041 |
| Newcastle United | 6.268486e-06 | 0.618401 | 0.220069 |
| Tottenham Hotspur | 1.288072e-01 | 0.085905 | 0.486383 |
| West Ham United | 5.502091e-01 | 0.223459 | 0.072989 |
| Wolverhampton Wanderers | 6.612554e-01 | 0.024138 | 0.217193 |
mfa.column_cosine_similarities_
| component | 0 | 1 | 2 |
|---|---|---|---|
| variable | |||
| (2021-22, W) | 0.777906 | 0.143956 | 0.023259 |
| (2021-22, D) | 0.115185 | 0.059083 | 0.622544 |
| (2021-22, L) | 0.532690 | 0.310599 | 0.109284 |
| (2021-22, GF) | 0.668238 | 0.225161 | 0.000802 |
| (2021-22, GA) | 0.394596 | 0.493301 | 0.006677 |
| (2021-22, Pts) | 0.753947 | 0.206439 | 0.000003 |
| (2022-23, W) | 0.732836 | 0.160893 | 0.001911 |
| (2022-23, D) | 0.242155 | 0.013664 | 0.307615 |
| (2022-23, L) | 0.511882 | 0.299042 | 0.151807 |
| (2022-23, GF) | 0.721335 | 0.067728 | 0.023182 |
| (2022-23, GA) | 0.317656 | 0.216240 | 0.267841 |
| (2022-23, Pts) | 0.704892 | 0.209854 | 0.022753 |
| (2023-24, W) | 0.896675 | 0.003433 | 0.042823 |
| (2023-24, D) | 0.169701 | 0.324593 | 0.236817 |
| (2023-24, L) | 0.859958 | 0.026863 | 0.001714 |
| (2023-24, GF) | 0.798944 | 0.003811 | 0.006929 |
| (2023-24, GA) | 0.609215 | 0.017098 | 0.005541 |
| (2023-24, Pts) | 0.931196 | 0.000274 | 0.015131 |
Column correlations
Column correlations (also called loadings) measure the Pearson correlation between each original variable and each MFA component. The squared correlations equal the cosine similarities.
mfa.column_correlations
| component | 0 | 1 | 2 |
|---|---|---|---|
| variable | |||
| (2021-22, W) | 0.881990 | -0.379416 | 0.152508 |
| (2021-22, D) | -0.339390 | -0.243071 | -0.789014 |
| (2021-22, L) | -0.729856 | 0.557314 | 0.330582 |
| (2021-22, GF) | 0.817458 | -0.474511 | -0.028325 |
| (2021-22, GA) | -0.628169 | 0.702354 | 0.081710 |
| (2021-22, Pts) | 0.868301 | -0.454356 | -0.001584 |
| (2022-23, W) | 0.856058 | 0.401114 | -0.043721 |
| (2022-23, D) | -0.492092 | 0.116892 | -0.554631 |
| (2022-23, L) | -0.715459 | -0.546848 | 0.389624 |
| (2022-23, GF) | 0.849315 | 0.260247 | -0.152257 |
| (2022-23, GA) | -0.563610 | -0.465016 | 0.517534 |
| (2022-23, Pts) | 0.839579 | 0.458098 | -0.150842 |
| (2023-24, W) | 0.946929 | 0.058592 | 0.206938 |
| (2023-24, D) | -0.411948 | -0.569731 | -0.486639 |
| (2023-24, L) | -0.927339 | 0.163900 | -0.041400 |
| (2023-24, GF) | 0.893837 | 0.061729 | -0.083240 |
| (2023-24, GA) | -0.780522 | -0.130760 | -0.074441 |
| (2023-24, Pts) | 0.964985 | -0.016546 | 0.123008 |
Group results
One of MFA’s most useful features is its ability to summarize results at the group level. Instead of examining 18 individual variable loadings, you can look at 3 group-level summaries — one per season. These correspond to FactoMineR’s result$group outputs.
This is especially valuable when groups are numerous and contain many variables, because a single group-level plot can replace dozens of individual variable plots.
Group coordinates indicate how strongly each group is associated with each MFA component. They are computed by summing the weighted squared variable coordinates within each group. A high value means that the group’s variables are collectively well-aligned with that component.
mfa.group_coordinates_
| component | 0 | 1 | 2 |
|---|---|---|---|
| group | |||
| 2021-22 | 0.712679 | 0.316175 | 0.167604 |
| 2022-23 | 0.738680 | 0.221191 | 0.177221 |
| 2023-24 | 0.924154 | 0.081475 | 0.066935 |
Group contributions show what percentage of each component’s variance is explained by each group. They sum to 100% across groups for each component. Here, the 2023-24 season contributes more to component 0 than the other seasons, meaning this component captures structure that is particularly prominent in that season.
mfa.group_contributions_.style.format('{:.0%}')
| component | 0 | 1 | 2 |
|---|---|---|---|
| group | |||
| 2021-22 | 30% | 51% | 41% |
| 2022-23 | 31% | 36% | 43% |
| 2023-24 | 39% | 13% | 16% |
Group cosine similarities (cos²) measure the quality of representation of each group on each component. The 2023-24 season has a very high cos² on component 0 (0.82), meaning this component captures most of that season’s internal structure. In contrast, the same season has a very low cos² on components 1 and 2, meaning those axes tell us little about within-season variation for 2023-24.
mfa.group_cosine_similarities_
| component | 0 | 1 | 2 |
|---|---|---|---|
| group | |||
| 2021-22 | 0.473967 | 0.093286 | 0.026214 |
| 2022-23 | 0.502188 | 0.045029 | 0.028906 |
| 2023-24 | 0.818300 | 0.006360 | 0.004293 |
Partial axes
Partial axes answer the question: how does each group’s own internal structure relate to the global MFA structure? Each group has its own PCA components (from the separate analyses in step 1). Partial axes show the correlation between these group-level components and the global MFA components.
This is useful for understanding whether all groups share the same dominant pattern (high correlations between each group’s first axis and the global first axis) or whether some groups introduce distinct structure on different global axes.
Partial correlations show the Pearson correlation between each group’s PCA components and the global MFA components. Here, all three seasons’ first component correlates strongly with the global first component (0.84, 0.85, 0.96), meaning the dominant pattern (strong vs. weak teams) is consistent across seasons. The 2021-22 season’s second component correlates with the global third component (-0.79), suggesting that season has a unique secondary pattern that shows up on a different global axis.
mfa.partial_correlations_
| component | 0 | 1 | 2 | |
|---|---|---|---|---|
| group | component | |||
| 2021-22 | 0 | 0.835657 | -0.524262 | -0.028301 |
| 1 | -0.215210 | -0.361226 | -0.786578 | |
| 2 | -0.197522 | -0.356472 | 0.288117 | |
| 2022-23 | 0 | 0.852769 | 0.436041 | -0.202374 |
| 1 | -0.194218 | 0.310181 | -0.689932 | |
| 2 | -0.014356 | -0.063442 | -0.040341 | |
| 2023-24 | 0 | 0.960582 | 0.073247 | 0.129441 |
| 1 | 0.078869 | -0.613825 | -0.465048 | |
| 2 | -0.051897 | 0.191498 | 0.185045 |
This can be visualized with plot_partial. Each arrow represents one group’s PCA axis projected onto the global MFA plane. Arrows close to the unit circle indicate a strong correlation. The plot clearly shows all three seasons’ first axis (dim 0) clustering on the right side of the circle — confirming they share the same dominant structure.
mfa.plot_partial(x_component=0, y_component=1)
Partial contributions show how much each group’s PCA axes contribute to each global MFA component. They sum to 100% per component across all group axes.
mfa.partial_contributions_.style.format('{:.0%}')
| component | 0 | 1 | 2 | |
|---|---|---|---|---|
| group | component | |||
| 2021-22 | 0 | 29% | 45% | 0% |
| 1 | 1% | 6% | 40% | |
| 2 | 0% | 1% | 1% | |
| 2022-23 | 0 | 31% | 31% | 10% |
| 1 | 0% | 4% | 34% | |
| 2 | 0% | 0% | 0% | |
| 2023-24 | 0 | 39% | 1% | 4% |
| 1 | 0% | 11% | 10% | |
| 2 | 0% | 1% | 1% |
