Open mathlf2015 opened 6 years ago
i find the same problem here ,but can't get the idea to sovle this problem https://stackoverflow.com/questions/44560823/generate-pmml-for-text-classification-pipeline-in-python
Exception in thread "main" java.lang.IllegalArgumentException: l2
The TfidfVectorizer.norm
attribute is not supported.
You have it set to "l2"
, but you need to set it to None
.
thank you very much . and best regards. i can't solve this problem without your help. and finally the model saved succsess. the code change as follows.
from sklearn2pmml.feature_extraction.text import Splitter
#before change
mapper = DataFrameMapper([
('pet', TfidfVectorizer()),
])
#under change
mapper = DataFrameMapper([
('pet', TfidfVectorizer(norm=None,analyzer = "word", tokenizer = Splitter())),
])
I was recently looking for a solution to transfer machine learning model across platforms between python and java. i want to use the TfidfVectorizer .however .the model can fit succsess.but can't save.the code as follows. anaconda python 3.6 linux
the debug as follows