AiLearning: 机器学习 - MachineLearning - ML、深度学习 - DeepLearning - DL、自然语言处理 NLP
python
nlp
svm
scikit-learn
sklearn
regression
logistic
dnn
lstm
pca
rnn
deeplearning
kmeans
adaboost
apriori
fp-growth
svd
naivebayes
mahchine-leaning
recommendedsystem
-
Updated
May 9, 2021 - Python
Hi I would like to propose a better implementation for 'test_indices':
We can remove the unneeded np.array casting:
Cleaner/New:
test_indices = list(set(range(len(texts))) - set(train_indices))
Old:
test_indices = np.array(list(set(range(len(texts))) - set(train_indices)))