Implement an incremental PCA routine that ingests data batch by batch and produces the top principal components without ever holding the full dataset in memory at once.
Write a function incremental_pca(batches, n_components) where:
batches is a list of batches. Each batch is a list of samples, where each sample is a list of feature values. Different batches may contain different numbers of samples, but the feature dimension is the same.n_components is the number of principal components to return.After consuming all batches sequentially (each batch updates running statistics), perform an eigendecomposition on the resulting covariance matrix (using 1/N normalization with N being the total number of samples seen) and return the top n_components eigenvectors as the rows of a list of lists, sorted from largest to smallest eigenvalue.
To make the output sign-deterministic, for each returned component flip its sign so that the entry with the largest absolute value is non-negative (ties broken by the first occurrence).
Return a Python list of lists (do not round inside the function).