用弦训练树

2024-03-29 09:46:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我怎样才能训练和学习弦呢。因此,当我输入字符串进行预测时,它会预测当前我试图添加字符串进行预测的时间cisionTreeClassifier.predict=预测它说它不能被转换成浮点数。你知道吗


Tags: 字符串时间predict浮点数cisiontreeclassifier
1条回答
网友
1楼 · 发布于 2024-03-29 09:46:51

在自然语言上训练机器学习分类器的一种方法是使用词包技术。Sklearn有CountVectorizer函数来执行标记化。你知道吗

根据文件:

In order to address this, scikit-learn provides utilities for the most common ways to extract numerical features from text content, namely:

  • Tokenizing strings and giving an integer id for each possible token, for instance by using white-spaces and punctuation as token separators.
    • Counting the occurrences of tokens in each document. normalizing and weighting with diminishing importance tokens that occur in the majority of samples / documents.
    • Features and samples are defined as follows:
    • Each individual token occurrence frequency (normalized or not) is treated as a feature. The vector of all the token frequencies for a given document is considered a multivariate sample.

相关问题 更多 >