Sklearn - Exceptions must derive from BaseException

0

I'm using a RandomForest classifier of sklearn, on Python 3.4 [yet to ugrade to 3.7]. The training data and labels are well prepared, and I train the algorithm as following:

classifier = RandomForestClassifier(n_jobs=4, n_estimators=500, criterion='entropy')
classifier.fit(trainingData, trainingLabels)

I get the following error on running this code:

Traceback (most recent call last):
  File "rf_withTest2.py", line 123, in <module>
    classifier.fit(trainingData, trainingLabels)
  File "C:\Users\admin\AppData\Roaming\Python\Python34\site-packages\sklearn\ensemble\forest.py", line 333, in fit
    for i, t in enumerate(trees))
  File "C:\Users\admin\AppData\Roaming\Python\Python34\site-packages\sklearn\externals\joblib\parallel.py", line 930, in __call__
    self.retrieve()
  File "C:\Users\admin\AppData\Roaming\Python\Python34\site-packages\sklearn\externals\joblib\parallel.py", line 833, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "C:\Python34\lib\multiprocessing\pool.py", line 594, in get
    raise self._value
TypeError: exceptions must derive from BaseException

I have used similar code before, which ran flawlessly. Cannot seem to understand the basis of this issue.

Debvrat Varshney

Posted 2019-04-03T04:13:09.687

Reputation: 1

No answers