Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Type error while generating cynet log files #3

Open
ctbaum opened this issue Dec 2, 2022 · 0 comments
Open

Type error while generating cynet log files #3

ctbaum opened this issue Dec 2, 2022 · 0 comments

Comments

@ctbaum
Copy link

ctbaum commented Dec 2, 2022

While closely following the cynet_crime_example.pdf script 6 fails with the following stacktrace

[Parallel(n_jobs=4)]: Using backend ThreadingBackend with 4 concurrent workers.
Traceback (most recent call last):
  File "/home/ubuntu/Home/Job/Python/Granger/Examples/ChicagoCrime/payload/script6.py", line 17, in <module>
    cn.run_pipeline(
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/cynet/cynet.py", line 2024, in run_pipeline
    Parallel(n_jobs = cores, verbose = 1, backend = 'threading')\
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/joblib/parallel.py", line 1098, in __call__
    self.retrieve()
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/joblib/parallel.py", line 975, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/multiprocessing/pool.py", line 774, in get
    raise self._value
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/multiprocessing/pool.py", line 125, in worker
    result = (True, func(*args, **kwds))
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/joblib/_parallel_backends.py", line 620, in __call__
    return self.func(*args, **kwargs)
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/joblib/parallel.py", line 288, in __call__
    return [func(*args, **kwargs)
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/joblib/parallel.py", line 288, in <listcomp>
    return [func(*args, **kwargs)
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/cynet/cynet.py", line 1884, in parallel_process
    M.select(var='delay',inplace=True,low=Horizon)
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/cynet/cynet.py", line 922, in select
    this_dict={key:this_dict[key] for key in list(this_dict.keys()) if key >= low }
  File "/home/ubuntu/miniconda3/envs/granger/lib/python3.10/site-packages/cynet/cynet.py", line 922, in <dictcomp>
    this_dict={key:this_dict[key] for key in list(this_dict.keys()) if key >= low }
TypeError: '>=' not supported between instances of 'int' and 'list'

The offending line in source code appears within

	def select(self,var="gamma",n=None,
			   reverse=False, store=None,
			   high=None,low=None,equal=None,inplace=False):
		"""
...

		Selects the N top models as ranked by var specified value
		(in reverse order if reverse is True)

		Inputs -
			var (string): model parameter to rank by
			n (int): number of models to return
			reverse (boolean): return in ascending order (True)
				or descending (False) order
			store (string): name of file to store selection json
			high (float): higher cutoff
			low (float): lower cutoff
			inplace (bool): update models if true

		Output -
			(dictionary): top n models as ranked by var
						 in ascending/descending order
		"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant