CostSensitiveClassification icon indicating copy to clipboard operation
CostSensitiveClassification copied to clipboard

CS-RF parallel error.

Open GoingMyWay opened this issue 7 years ago • 0 comments

When run CS-RF using n_job=2 on jupyter notebook, I got the following error. Python version: 2.7. And when setting n_job=1, no error occurs.

/usr/lib/python2.7/site-packages/costcla/models/bagging.pyc in fit(self, X, y, cost_mat, sample_weight)
    273                 seeds[starts[i]:starts[i + 1]],
    274                 verbose=self.verbose)
--> 275             for i in range(n_jobs))
    276 
    277         # Reduce

/usr/lib64/python2.7/site-packages/sklearn/externals/joblib/parallel.pyc in __call__(self, iterable)
    787                 # consumption.
    788                 self._iterating = False
--> 789             self.retrieve()
    790             # Make sure that we get a last message telling us we are done
    791             elapsed_time = time.time() - self._start_time

/usr/lib64/python2.7/site-packages/sklearn/externals/joblib/parallel.pyc in retrieve(self)
    697             try:
    698                 if getattr(self._backend, 'supports_timeout', False):
--> 699                     self._output.extend(job.get(timeout=self.timeout))
    700                 else:
    701                     self._output.extend(job.get())

/usr/lib64/python2.7/multiprocessing/pool.pyc in get(self, timeout)
    552             return self._value
    553         else:
--> 554             raise self._value
    555 
    556     def _set(self, i, obj):

MaybeEncodingError: Error sending result: '[([CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True), CostSensitiveDecisionTreeClassifier(criterion='direct_cost',
                  criterion_weight=False, max_depth=None,
                  max_features='auto', min_gain=0.001, min_samples_leaf=1,
                  min_samples_split=2, num_pct=100, pruned=True)], [array([False,  True, False, ...,  True, False,  True], dtype=bool), array([False,  True,  True, ...,  True, False, False], dtype=bool), array([ True,  True,  True, ...,  True, False,  True], dtype=bool), array([ True,  True,  True, ...,  True,  True,  True], dtype=bool), array([False, False,  True, ...,  True,  True,  True], dtype=bool), array([ True,  True,  True, ...,  True,  True,  True], dtype=bool), array([ True,  True,  True, ...,  True, False,  True], dtype=bool), array([ True,  True, False, ...,  True,  True, False], dtype=bool)], [array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39]), array([ 0,  1,  2,  3,  4,  5,  6,  7,  8,  9, 10, 11, 12, 13, 14, 15, 16,
       17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33,
       34, 35, 36, 37, 38, 39])])]'. Reason: 'PicklingError("Can't pickle <class costcla.models.cost_tree._tree_class at 0x7261ae0>: it's not found as costcla.models.cost_tree._tree_class",)'

GoingMyWay avatar Dec 24 '17 02:12 GoingMyWay