Skip to content

Commit

Permalink
fix: Correct the parameters passed to the plotting function in PCA De…
Browse files Browse the repository at this point in the history
…composition
  • Loading branch information
HaibinLai committed Sep 19, 2024
1 parent f81fc36 commit d3ecd37
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions geochemistrypi/data_mining/model/decomposition.py
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,7 @@ def special_components(self, **kwargs: Union[Dict, np.ndarray, int]) -> None:
# Draw graphs when the number of principal components > 3
if kwargs["components_num"] > 3:
# choose two of dimensions to draw
two_dimen_axis_index, two_dimen_pc_data = self.choose_dimension_data(self.pc_data, 2)
two_dimen_axis_index, two_dimen_pc_data = self.choose_dimension_data(self.X_reduced, 2)
two_dimen_reduced_data = self.X_reduced.iloc[:, two_dimen_axis_index]
self._biplot(
reduced_data=two_dimen_reduced_data,
Expand All @@ -340,7 +340,7 @@ def special_components(self, **kwargs: Union[Dict, np.ndarray, int]) -> None:
)

# choose three of dimensions to draw
three_dimen_axis_index, three_dimen_pc_data = self.choose_dimension_data(self.pc_data, 3)
three_dimen_axis_index, three_dimen_pc_data = self.choose_dimension_data(self.X_reduced, 3)
three_dimen_reduced_data = self.X_reduced.iloc[:, three_dimen_axis_index]
self._triplot(
reduced_data=three_dimen_reduced_data,
Expand All @@ -352,7 +352,7 @@ def special_components(self, **kwargs: Union[Dict, np.ndarray, int]) -> None:
)
elif kwargs["components_num"] == 3:
# choose two of dimensions to draw
two_dimen_axis_index, two_dimen_pc_data = self.choose_dimension_data(self.pc_data, 2)
two_dimen_axis_index, two_dimen_pc_data = self.choose_dimension_data(self.X_reduced, 2)
two_dimen_reduced_data = self.X_reduced.iloc[:, two_dimen_axis_index]
self._biplot(
reduced_data=two_dimen_reduced_data,
Expand Down

0 comments on commit d3ecd37

Please sign in to comment.