You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is because min number of clusters was set to 4 in ch4_optimal_clustering.py in clusterKMeansBase, but it should be 2. I have updated this in this commit: 5acb8a5
When I run the script called 'ch7_portfolio_construction' I get the following error:
AttributeError Traceback (most recent call last)
in
39 cov1 = pd.DataFrame(cov1, index=cols, columns=cols)
40 corr1 = mp.cov2corr(cov1)
---> 41 corr1, clstrs, silh = oc.clusterKMeansBase(pd.DataFrame(corr0))
42
43 # # code snippet 7.4 - intracluster optimal allocations
D:\User\Desktop\ch4_optimal_clustering.py in clusterKMeansBase(corr0, maxNumClusters, n_init, debug)
56 print("********")
57
---> 58 newIdx = np.argsort(kmeans.labels_)
59 #print(newIdx)
60
AttributeError: 'NoneType' object has no attribute 'labels_'
Can you please help me to fix this bug? Thank you!
The text was updated successfully, but these errors were encountered: