Comments (4)
@sergioburdisso Hm unsure about that one because...
- Where to start and where to end? Is it only
fit/train
that needs this kind of validation or also other methods (potentially all methods with user input because of consistency)? - I think it's difficult to detect if a
x_train
can be casted to a list of strings without information loss. E.g. whilepandas.DataFrame
can't be casted,pandas.Series
can be casted without issues, so it should stay a valid option? - Its well documented, stating exactly what the function expects.
from pyss3.
Hey @Practcdi,
TLDR
this is due to the case, that fit/train
requires a list of strings instead of a DataFrame. (See function documentation here)
Fix: pass x_train.values.tolist(), y_train
to clf.train()
Bit more insights on why it does not work:
Following the respective code lines (here):
x_train, y_train = list(x_train), list(y_train)
if len(x_train) != len(y_train):
raise ValueError("`x_train` and `y_train` must have the same length")
If you pass a dataframe to the variable x_train
of shape = (535544, 1)
casting this to a list will only return the column names.
Thus the check will compare the following:
if 1 != 535544:
raise ValueError("`x_train` and `y_train` must have the same length")
from pyss3.
Hey @Practcdi,
TLDR
this is due to the case, that
fit/train
requires a list of strings instead of a DataFrame. (See function documentation here)Fix: pass
x_train.values.tolist(), y_train
toclf.train()
Bit more insights on why it does not work:
Following the respective code lines (here):
x_train, y_train = list(x_train), list(y_train) if len(x_train) != len(y_train): raise ValueError("`x_train` and `y_train` must have the same length")
If you pass a dataframe to the variable
x_train
ofshape = (535544, 1)
casting this to a list will only return the column names. Thus the check will compare the following:if 1 != 535544: raise ValueError("`x_train` and `y_train` must have the same length")
Thanks lot 😊
from pyss3.
@Practcdi Thanks for sharing this issue with us!
@angrymeir Thanks for taking care of it 💪, btw, what do you think of adding an extra check at the beginning of fit/train
throwing an ValueError
exception saying something like "the x_train
argument is expected to be a list of strings" when the provided x_train
isn't a list of string. 🤔
from pyss3.
Related Issues (20)
- Divison by 0 HOT 4
- Initialization of sanction function HOT 6
- Custom metrics for evaluation HOT 5
- Use evaluation and explanation as a standalone package? HOT 2
- Partial learn HOT 10
- [joss] update the changelog HOT 1
- [joss] update entry site of the documentation HOT 1
- [joss] feature request: accessible utility to import a dataset HOT 4
- Error in Live_test HOT 5
- [joss] software paper comments HOT 1
- [JOSS] comments on the paper
- AttributeError: type object 'Dataset' has no attribute 'load_from_url' HOT 3
- AttributeError: type object 'Dataset' has no attribute 'load_from_url' HOT 3
- PYSS3 support for multi-class classification
- Custom preprocessing in Live Test HOT 8
- Multilabel Classification Evaluation HOT 14
- Multilabel Classification Dataset Loading HOT 4
- Change of category name HOT 1
- Multilabel Live Test HOT 3
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 pyss3.