causal-forest
causal-forest copied to clipboard
Parallel Problems
I am able to run your code when I manually set num_workers = 1, but anytime I try to use parallel, I get the following:
File "
File "C:\Users\levic\Desktop\Oregon\forest.py", line 154, in fit seed_counter=self.seed_counter,
File "C:\Users\levic\Desktop\Oregon\forest.py", line 327, in fit_causalforest for i in range(num_trees)
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib\parallel.py", line 921, in call if self.dispatch_one_batch(iterator):
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib\parallel.py", line 759, in dispatch_one_batch self._dispatch(tasks)
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib\parallel.py", line 716, in _dispatch job = self._backend.apply_async(batch, callback=cb)
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib_parallel_backends.py", line 182, in apply_async result = ImmediateResult(func)
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib_parallel_backends.py", line 549, in init self.results = batch()
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib\parallel.py", line 225, in call for func, args, kwargs in self.items]
File "C:\Users\levic\Anaconda3\lib\site-packages\joblib\parallel.py", line 225, in
File "C:\Users\levic\Desktop\Oregon\forest.py", line 368, in _fit_single_tree_for_forest critparams=treeparams,
File "C:\Users\levic\Desktop\Oregon\tree.py", line 55, in fit_causaltree X=X, t=t, y=y, index=index, critparams=critparams, idparams=idparams,
File "C:\Users\levic\Desktop\Oregon\tree.py", line 101, in _fit_node X=X, t=t, y=y, index=index, min_leaf=critparams["min_leaf"],
File "C:\Users\levic\Desktop\Oregon\tree.py", line 203, in _find_optimal_split min_leaf=min_leaf,
File "C:\Users\levic\Anaconda3\lib\site-packages\numba\dispatcher.py", line 376, in _compile_for_args error_rewrite(e, 'typing')
File "C:\Users\levic\Anaconda3\lib\site-packages\numba\dispatcher.py", line 343, in error_rewrite reraise(type(e), e, None)
File "C:\Users\levic\Anaconda3\lib\site-packages\numba\six.py", line 658, in reraise raise value.with_traceback(tb)
TypingError: Invalid use of Function(
- parameterized In definition 0: All templates rejected with literals. In definition 1: All templates rejected without literals. In definition 2: All templates rejected with literals. In definition 3: All templates rejected without literals. In definition 4: All templates rejected with literals. In definition 5: All templates rejected without literals. In definition 6: All templates rejected with literals. In definition 7: All templates rejected without literals. In definition 8: All templates rejected with literals. In definition 9: All templates rejected without literals. In definition 10: TypeError: unsupported array index type array(bool, 2d, C) in [array(bool, 2d, C)] raised from C:\Users\levic\Anaconda3\lib\site-packages\numba\typing\arraydecl.py:71 In definition 11: TypeError: unsupported array index type array(bool, 2d, C) in [array(bool, 2d, C)] raised from C:\Users\levic\Anaconda3\lib\site-packages\numba\typing\arraydecl.py:71 This error is usually caused by passing an argument of a type that is unsupported by the named function. [1] During: typing of intrinsic-call at C:\Users\levic\Desktop\Oregon\tree.py (259)
Hello spot92, thanks for finding my repository and playing around with my code.
I presume you were running the code on a Windows machine. Unfortunately I haven't tested the code on a Windows machine yet. I will do so once I continue to work on this project.
Sadly I cannot recommend using my software at the moment. I actually plan on rewriting the package to wrap existing C++ code which is fully tested. Then I will also test that all features run on all operating systems..