AttributeError: 'PiecewiseLinFit' object has no attribute 'beta'
See original GitHub issueHi, thanks for the package!
When trying to run the examples here https://jekel.me/piecewise_linear_fit_py/examples.html, I am consistently running into the error AttributeError: ‘PiecewiseLinFit’ object has no attribute ‘beta’. For example, following the ‘fit for specified number of line segments’ example, I get:
yHat = my_pwlf.predict(xHat)
File "/Users/tom/phd/entity_extraction/piecewise_linear_fit_py/pwlf/pwlf.py", line 609, in predict
y_hat = np.dot(A, self.beta)
AttributeError: 'PiecewiseLinFit' object has no attribute 'beta'
I am using Python 3.5.6. I tried both pip install pwlf and installing from source and got the same issue. Let me know if you need any more info. Thanks!
Issue Analytics
- State:
- Created 4 years ago
- Comments:8 (6 by maintainers)
Top Results From Across the Web
AttributeError: 'Model' object has no attribute 'beta' when trying ...
My overall goal has been to save and load model data. I have been trying to do this in the policy.py file in...
Read more >pwlf package contents — pwlf 2.2.1 documentation
The objective function to perform a continuous piecewise linear fit for a specified number of breakpoints. This is to be used with a...
Read more >[Solved] AttributeError: 'module' object has no attribute
Click here to subscribe - https://www.youtube.com/channel/UCeVMnSShP_Iviwkknt83cww▻Instagram ...
Read more >Python AttributeError — What is it and how do you fix it?
AttributeError : '***' object has no attribute '***'What is an AttributeError in Python? What can you do to fix it? When does it...
Read more >AttributeError: 'module' object has no attribute and ImportError
This video covers the AttributeError : 'module' object has no attribute and ImportError: No module name errors in Python.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thanks for following up. I can confirm that the initial report was also on MacOS.
I have the issue with SciPy 1.1.0. I checked and in my case, my_pwlf.breaks is not defined (AttributeError: ‘PiecewiseLinFit’ object has no attribute ‘breaks’) and my_pwlf.ssr == +inf. It works fine with scipy 1.2.0. I’m on MacOS, maybe that the cause: before 1.2.0, SciPy was using Apple Accelerate as LAPACK implementation. They dropped it in 1.2.0 because it had bugs (among other reasons), as described here: https://github.com/scipy/scipy/wiki/Dropping-support-for-Accelerate I’m not sure how to confirm that, as I don’t know which OS the initial report was on.