'PLS-DA coef intepratation

I would like to interpret the direction of the coefficient from the pls-da,

library(mdatools)
library(dplyr)
data(iris)

m.vir <- plsda(x = iris[, 1:4], c = iris[, 5], cv = 1)

plotRegcoeffs(m.vir, ncomp = 1, show.ci = TRUE)

plotRegcoeffs(m.vir, ncomp = 2, show.ci = TRUE)

The coefficients from 1 PC are

 plotRegcoeffs(m.vir, ncomp = 1, show.ci = TRUE)

enter image description here

But for 2 PC the effect of Sepal.Length is totally different

 plotRegcoeffs(m.vir, ncomp = 2, show.ci = TRUE)

enter image description here

What is the meaning in the direction of coefficients?

By knowing that the setosa has lower average for Sepal.Length how can I use this information to understand if the 2nd component is useful or overfits?

iris[1:100, ] %>% group_by( Species) %>% summarise((across(everything(), mean)))

  Species    Sepal.Length Sepal.Width Petal.Length Petal.Width
  <fct>             <dbl>       <dbl>        <dbl>       <dbl>
1 setosa             5.01        3.43         1.46       0.246
2 versicolor         5.94        2.77         4.26       1.33 


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source