question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: 'PiecewiseLinFit' object has no attribute 'beta'

See original GitHub issue

Hi, 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:closed
  • Created 4 years ago
  • Comments:8 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
tomsilvercommented, Feb 3, 2020

Thanks for following up. I can confirm that the initial report was also on MacOS.

1reaction
bezineb5commented, Feb 3, 2020

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found