Comments (5)
Thanks for the message. I can imagine this happening if fit_model
is called with unexpected arguments, but should work if called correctly. For example, it is used in seeds_threshold.py
and it works on my side.
Can you please post a full example that triggers the error for you?
from buildingmachinelearningsystemswithpython.
Thanks for pointing in the right direction. What I had failed to notice earlier was that after calling the function, the arrays, pred
and labels
were having different lengths which was yielding a single boolean value. In fact, this is the case that is happening in the code snippet contained in chapter.py
at the below location:
Here, pred
is a boolean array of length 100 whereas is_virginica
is a boolean array of length 150 which is generating a single bool value. In my opinion, we should add one more line after building is_virginica
as below to select non-setosa labels only as we are using only non-setosa features:
is_virginica = is_virginica[~is_setosa]
from buildingmachinelearningsystemswithpython.
Is this line 69 in the current (second edition) version of chapter.py
? If so, it runs correctly on my side.
Note that is_virginica
is defined as is_virginica = (labels == 'virginica')
after labels = labels[~is_setosa]
.
If you are using the first edition, I do remember that there were a few of these manipulations which were (unfortunately) not in the book.
from buildingmachinelearningsystemswithpython.
Unfotunately, I am using the first edition of the book. However, I am now able to execute the code without any errors. Thanks for all your support.
from buildingmachinelearningsystemswithpython.
Great that you solved your problem.
The code related updates to the book are all in this repository, so if you run into any issues, check here or get in touch (we're always happy to help).
from buildingmachinelearningsystemswithpython.
Related Issues (13)
- totsv ch05 : parsing error HOT 1
- set directory to utils.py in chapter 09 HOT 1
- cannot import name 'CHART_DIR' HOT 3
- Execution killed HOT 2
- Movie features, user features HOT 10
- TypeError: unsupported operand type(s) for +: 'int' and 'str' HOT 1
- Logic error in code HOT 4
- utils.load_sanders_data() in ch06 doesn't work
- build LDA model by using AP data fail
- Ch5: Can't dowload data because ClearBits permanently shut down HOT 2
- ch09 is not correct HOT 2
- Example with a single Tweet - Chapter6
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 buildingmachinelearningsystemswithpython.