Столкнувшись с проблемой при реализации нейронной сети - PullRequest
0 голосов
/ 17 января 2020

При реализации нейронной сети для табличных данных с использованием fastai , я столкнулся с этой ошибкой в ​​функции learn.predict

.
. Пересмотреть цель учащегося

отклонено 4.0000 отклонено

принято 2.0000 принято

принято 1.0000 принято

отклонено 1.0000 отклонено

отклонено 4.0000 отклонено

Это набор данных, который я использую для реализации нейронной сети

data = (TabularList.from_df(df, path=path, cat_names=['Review'],cont_names=['Student'],procs=procs)
                           .split_none()
                           .label_from_df(cols=dep_var)
                           .databunch(bs=5))

Это DataBunch, который я создал.

KeyError Traceback (most recent call last)
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2896 try:
-> 2897 return self._engine.get_loc(key)
2898 except KeyError:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: ‘Review’

During handling of the above exception, another exception occurred:

KeyError Traceback (most recent call last)
10 frames
/usr/local/lib/python3.6/dist-packages/pandas/core/indexes/base.py in get_loc(self, key, method, tolerance)
2897 return self._engine.get_loc(key)
2898 except KeyError:
-> 2899 return self._engine.get_loc(self._maybe_cast_indexer(key))
2900 indexer = self.get_indexer([key], method=method, tolerance=tolerance)
2901 if indexer.ndim > 1 or indexer.size > 1:

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/index.pyx in pandas._libs.index.IndexEngine.get_loc()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

pandas/_libs/hashtable_class_helper.pxi in pandas._libs.hashtable.PyObjectHashTable.get_item()

KeyError: ‘Review’*
...