Running the below code will fail ~15% of the iterations.
for i in range(100):
PCAmodel = ChemometricsPCA(ncomps=10, scaler=scaler_obj)
data = numpy.random.lognormal(size=(10, 10)) + 1
PCAmodel._npyc_dataset_shape = {'NumberSamples': data.shape[0], 'NumberFeatures': data.shape[1]}
PCAmodel.fit(data)
try:
scree_cv = PCAmodel._screecv_optimize_ncomps(data, total_comps=10, stopping_condition=0.05)
except:
print('failed')