【问题标题】:AttributeError: 'TfidfVectorizer' object has no attribute 'tranform' [closed]AttributeError:“TfidfVectorizer”对象没有属性“转换”[关闭]
【发布时间】:2021-09-01 08:04:52
【问题描述】:

我不断收到此代码的此错误,

x_predict = ['facebook.com', 'google.com/search=phish', 'wikipedia.com']

x_predict = vectorizer.transform(x_predict)

y_predict = lgr.predict(x_predict)

打印(y_predict)

【问题讨论】:

    标签: python machine-learning transform attributeerror tfidfvectorizer


    【解决方案1】:

    这是拼写错误:

    使用transform 而不是tranform

    x_predict = vectorizer.transform(x_predict)
    

    【讨论】:

    • 谢谢。我的坏...
    • @Lunatic 欢迎来到 Stack Overflow;如果答案解决了您的问题,请接受。
    猜你喜欢
    • 2023-01-19
    • 2015-09-24
    • 1970-01-01
    • 2017-05-24
    • 2021-07-06
    • 2016-08-16
    • 2020-11-17
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多