Comments (2)
I used persim v0.3.1 from PyPI with Python 3.10.9, and I ran into the same error. Here is the traceback I got:
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
Cell In[4], line 17
15 dgm0 = ripser(D, maxdim=0, distance_matrix=True)['dgms'][0]
16 pds.append(np.clip(dgm0,a_min=-2,a_max=2)) # clip min/max birth/death
---> 17 pims.append(pim.transform(pds[i])) # vectorise by persistence image
18 for i in range(4): # plot persistence images
19 ax = plt.subplot(240+i+1)
File ~/anaconda3/envs/tda/lib/python3.10/site-packages/sklearn/utils/_set_output.py:142, in _wrap_method_output.<locals>.wrapped(self, X, *args, **kwargs)
140 @wraps(f)
141 def wrapped(self, X, *args, **kwargs):
--> 142 data_to_wrap = f(self, X, *args, **kwargs)
143 if isinstance(data_to_wrap, tuple):
144 # only wrap the first output for cross decomposition
145 return (
146 _wrap_data_with_container(method, data_to_wrap[0], X, self),
147 *data_to_wrap[1:],
148 )
File ~/anaconda3/envs/tda/lib/python3.10/site-packages/persim/images.py:577, in PersistenceImager.transform(self, pers_dgms, skew, n_jobs)
574 return np.zeros(self.resolution)
576 # convert to a list of diagrams if necessary
--> 577 pers_dgms, singular = self._ensure_iterable(pers_dgms)
579 if parallelize:
580 pers_imgs = Parallel(n_jobs=n_jobs)(delayed(_transform)(pers_dgm, skew, self.resolution, self.weight, self.weight_params, self.kernel, self.kernel_params, self._bpnts, self._ppnts) for pers_dgm in pers_dgms)
File ~/anaconda3/envs/tda/lib/python3.10/site-packages/persim/images.py:618, in PersistenceImager._ensure_iterable(self, pers_dgms)
615 def _ensure_iterable(self, pers_dgms):
616 # if first entry of first entry is not iterable, then diagrams is singular and we need to make it a list of diagrams
617 try:
--> 618 singular = not isinstance(pers_dgms[0][0], collections.Iterable)
619 except IndexError:
620 singular = False
AttributeError: module 'collections' has no attribute 'Iterable'
From a quick search, it looks like it's a deprecation issue? I'm not familiar with this, but I'm just wanting to add what I ran into.
from persim.
@TheChymera @kevin931 This should be fixed in persim v0.3.2. If the issue remains, please re-open.
from persim.
Related Issues (20)
- Default weighting function normalization
- prism Persistent Image issue HOT 2
- Bottleneck distance between repeated intervals = 0 HOT 2
- Sliced Wasserstein distance vs Wasserstein distance HOT 1
- Plotting landscapes
- Gaussian mean parameters in PersistenceImager HOT 1
- Persistence weight function and negative values in persistence image HOT 1
- persistent landscape HOT 2
- PersistenceImager error HOT 3
- Sorry, but I really to know what function this line of code do HOT 1
- Persistence Landscape HOT 1
- Persistence Image for H0, H1, and H2 plus dropping inf values HOT 2
- `=perism-0.2.0` multiple tests fail HOT 1
- `=persim-0.3.0` 13 tests fail (`AttributeError` and `ValueError`) HOT 2
- Test failure with Python 3.10 HOT 1
- Bug Report: `persim.bottleneck` returns 0 for distinct diagrams HOT 2
- How to calculate the distance between two landscapes? HOT 2
- bring CI pipeline up to Python 3.12 HOT 1
- Persistence Landscapes and Machine Learning notebook issue HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from persim.