zidik / Self-labeled-techniques-for-semi-supervised-learning

23 stars 5 forks source link

ValueError: need at least one array to concatenate #1

Open Snowfy1031 opened 5 years ago

Snowfy1031 commented 5 years ago

Thank for your program,I try to run it , but I meet the error:

ValueError Traceback (most recent call last)

in 21 test_info = { "classifier": classifier.name, "dataset":dataset_name, "labeling_rate":labeling_rate} 22 cv = KFold(n_splits=10, random_state=42) ---> 23 scores, cnf_matrix = train_and_score(classifier, dataset["X"], dataset["y"], cv, labeling_rate) 24 25 if results is None: in train_and_score(clf, X, y, cv, labeling_rate) 48 testing_scores = [] 49 for training_index, test_index in cv.split(X,y): ---> 50 transductive_score, testing_score, cnf_matrix = _training_scoring_iteration(clf, X, y, training_index, test_index, labeling_rate) 51 52 transductive_scores.append(transductive_score) in _training_scoring_iteration(clf, X, y, training_index, test_index, labeling_rate) 28 29 #Train the classifier ---> 30 clf.fit(X_train, y_train) 31 32 #Score the classifier ~/tri_training.py in fit(self, X, y) 25 changed = False 26 for t1, t2, t3 in third_rotations: ---> 27 changed |= t1.train(t2, t3, X[unlabeled]) 28 29 ~/tri_training.py in train(self, t1, t2, unlabeled_X) 76 count_of_added = len(L_X) 77 # Turn the python list of chosen samples into numpy array ---> 78 L_X = np.concatenate(L_X) 79 L_y = np.concatenate(L_y) 80 ValueError: need at least one array to concatenate If you could help me,I will be grateful :)
zidik commented 5 years ago

This project was created almost 3 years ago. Probably the libraries that this code depends on have introduced some breaking changes, so it would make sense to try using Python and library versions that were available at the beginning of the year 2017.

Unfortunately, I have not recorded the specific versions used.

Snowfy1031 commented 5 years ago

This project was created almost 3 years ago. Probably the libraries that this code depends on have introduced some breaking changes, so it would make sense to try using Python and library versions that were available at the beginning of the year 2017.

Unfortunately, I have not recorded the specific versions used.

Thank you, I will try it later