for logistic regreetion, got "ValueError: The input should be a vector, please check your input data."
Created by: 690609237
1. def reader():
2. UNK_ID = word_dict["<UNK>"]
3. word_col = 1
4. teacher_label_col = 0
5. for file_name in os.listdir(data_dir):
6. with open(os.path.join(data_dir, file_name), "r") as f:
7. for line in f:
8. line_split = line.strip().split("\t")
9. word_ids = [
10. word_dict.get(w, UNK_ID)
11. for w in line_split[word_col].split() ]
12. y_value = float(line_split[teacher_label_col])
13. yield word_ids, y_value
14. return reader
this is my reader code, y_value is float type, x value is writed as words_ids like [12, 34, 55]. when run got "ValueError:The input should be a vector, please check your input data." when I try to replace the line 12 to "y_value = [float(line_split[teacher_label_col])]" , got a core bug..