added notebook converted to python file to estimate number of components in data