In the lab, when I compare the value between after fitting first and then transform and fit_transform, the values are different. May I know why?

What is the correct way to train the model?

When is fit_transform used?

The below data got from the below script

```
pca = PCA(n_components=2)
pcaTr = pca.fit(data)
rotatedData = pcaTr.transform(data)
print(rotatedData)
```

output of rotatedData is

```
[[ 1.18203639e-01 -1.80313098e-17]
[-3.10730854e-01 4.02403129e-17]
[ 7.07800064e-01 -9.06820347e-17]
...
[-2.37859417e-01 4.41683190e-17]
[ 2.46974568e-01 -3.50195185e-17]
[-3.87314439e-01 5.63003266e-17]]
```

The below data got from fit_transform

```
pca = PCA(n_components=2)
pcafittransform = pca.fit_transform(data)
print(pcafittransform)
```

output of pcafittransform is

```
[[ 1.18203639e-01 2.13887570e-15]
[-3.10730854e-01 4.43358337e-19]
[ 7.07800064e-01 1.22284872e-17]
...
[-2.37859417e-01 -7.72652317e-18]
[ 2.46974568e-01 7.43178405e-18]
[-3.87314439e-01 -9.86177461e-18]]
```

Thank you.