What I’m trying to do:
I have a SKlearn Vectorizer that I am trying to load into a server function. I am able to do so with no issues in local jupter notebook, but when I try calling the Vectorizer to vectorize an input, I get the following error:
AttributeError: ‘LinearSVC’ object has no attribute 'transform’at [ServerModule1, line 40](javascript:void(0))called from /downlink/anvil/_server.py, line 1469
I know this to be incorrect because TfidfVectorizer certainly has a transform argument.
I have to imagine that this issue is arising from SKlearn not being properly installed in the Anvil servers?
What I’ve tried and what’s not working:
I have checked to make sure that the vectorizer, which I load from a pickle file stored as a media object in a datatable is loaded correctly, and indeed it has (its type is class ‘sklearn.feature_extraction.text.TfidfVectorizer’).
Code Sample:
# this is a formatted code snippet.
# paste your code between ```
Clone link:
share a copy of your app