index 1 is out of bounds for axis 0 with size 1 in machine learning

154 Views Asked by At

I don't know why but its showing index 1 is out of bounds for axis 0 with size 1 on acc[i], Its a program for semi supervised learning. Can someone help me what no should be in np.empty()

nc =np.arange(.40, 1, .03)
acc = np.empty(1)
i = 0
for k in np.nditer(nc):
    conf_ind = df['max'] > k
    X_train1 = np.append(x_train_np, unl_np[conf_ind, :], axis=0)
    Y_train1 = np.append(y_train_np, df.loc[conf_ind, ['lab']])
    clf = svm.SVC(kernel='linear', probability= True, C=1).fit(X_train1, Y_train1)
    acc[i] = clf.score(x_test, y_test)
    i = i + 1
    ```

Note: This is just part of the whole code but the problem is most probably within this code.
0

There are 0 best solutions below