<｜begin▁of▁sentence｜>### Instruction:
Given a dataset represented as a matrix with 100 observations and 50 features, how can a scree plot be used to visualize the distribution of singular values and potentially identify the optimal number of principal components to retain for dimensionality reduction?
### Response:
import numpy as np
import matplotlib.pyplot as plt
from graspologic.plot import screeplot
from sklearn.decomposition import PCA

# Create a random matrix with more rows than columns
X = np.random.rand(100, 50)

# Run PCA on the matrix and get the singular values
pca = PCA()
pca.fit(X)
singular_values = pca.singular_values_

# Plot the scree plot
fig, ax = plt.subplots()
screeplot(X=singular_values, title='Scree Plot', context='talk',
          font_scale=1.5, figsize=(12, 6), cumulative=False,
          show_first=10, show_elbow=True, ax=ax)
plt.show()
<|EOT|>
