Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ValueError: need at least one array to concatenate #1

Open
Snowfy1031 opened this issue Oct 7, 2019 · 2 comments
Open

ValueError: need at least one array to concatenate #1

Snowfy1031 opened this issue Oct 7, 2019 · 2 comments

Comments

@Snowfy1031
Copy link

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
Copy link
Owner

zidik commented Oct 7, 2019

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
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants