<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Text Mining on 中文AI术语词典</title><link>https://terms-en.ai-term-hub.com/zh/tags/text-mining/</link><description>Recent content in Text Mining on 中文AI术语词典</description><generator>Hugo</generator><language>zh-cn</language><lastBuildDate>Sat, 18 Jul 2026 11:44:45 +0000</lastBuildDate><atom:link href="https://terms-en.ai-term-hub.com/zh/tags/text-mining/index.xml" rel="self" type="application/rss+xml"/><item><title>特征哈希</title><link>https://terms-en.ai-term-hub.com/zh/terms/feature_hashing/</link><pubDate>Sat, 18 Jul 2026 11:17:13 +0000</pubDate><guid>https://terms-en.ai-term-hub.com/zh/terms/feature_hashing/</guid><description>&lt;h2 id="definition">Definition&lt;/h2>
&lt;p>特征哈希，也称为哈希技巧（hashing trick），允许机器学习模型处理大型稀疏特征空间，而无需维护特征与索引之间的显式映射。通过应用哈希函数，模型可以直接将任意特征映射到固定的向量维度中，从而节省内存并简化特征工程流程。&lt;/p>
&lt;h3 id="summary">Summary&lt;/h3>
&lt;p>一种利用哈希函数将高维稀疏特征映射到固定大小向量的技术。&lt;/p>
&lt;h2 id="key-concepts">Key Concepts&lt;/h2>
&lt;ul>
&lt;li>哈希函数&lt;/li>
&lt;li>稀疏向量&lt;/li>
&lt;li>降维&lt;/li>
&lt;li>内存效率&lt;/li>
&lt;/ul>
&lt;h2 id="use-cases">Use Cases&lt;/h2>
&lt;ul>
&lt;li>具有大型词汇表的文本分类&lt;/li>
&lt;li>拥有海量物品集的推荐系统&lt;/li>
&lt;li>实时流数据处理&lt;/li>
&lt;/ul>
&lt;h2 id="code-example">Code Example&lt;/h2>
&lt;div class="highlight">&lt;pre tabindex="0" style="color:#f8f8f2;background-color:#272822;-moz-tab-size:4;-o-tab-size:4;tab-size:4;">&lt;code class="language-python" data-lang="python">&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">from&lt;/span> sklearn.feature_extraction &lt;span style="color:#f92672">import&lt;/span> FeatureHasher
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#f92672">import&lt;/span> numpy &lt;span style="color:#66d9ef">as&lt;/span> np
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>&lt;span style="color:#75715e"># Example: Hashing text features&lt;/span>
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hasher &lt;span style="color:#f92672">=&lt;/span> FeatureHasher(n_features&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#ae81ff">10&lt;/span>, input_type&lt;span style="color:#f92672">=&lt;/span>&lt;span style="color:#e6db74">&amp;#39;string&amp;#39;&lt;/span>)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>docs &lt;span style="color:#f92672">=&lt;/span> [&lt;span style="color:#e6db74">&amp;#39;hello world&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;hello python&amp;#39;&lt;/span>, &lt;span style="color:#e6db74">&amp;#39;world python&amp;#39;&lt;/span>]
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>hashed &lt;span style="color:#f92672">=&lt;/span> hasher&lt;span style="color:#f92672">.&lt;/span>transform(docs)
&lt;/span>&lt;/span>&lt;span style="display:flex;">&lt;span>print(hashed&lt;span style="color:#f92672">.&lt;/span>toarray())
&lt;/span>&lt;/span>&lt;/code>&lt;/pre>&lt;/div>&lt;h2 id="related-terms">Related Terms&lt;/h2>
&lt;ul>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/one-hot-encoding-%E7%8B%AC%E7%83%AD%E7%BC%96%E7%A0%81/">One-hot encoding (独热编码)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/bag-of-words-%E8%AF%8D%E8%A2%8B%E6%A8%A1%E5%9E%8B/">Bag of Words (词袋模型)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/dimensionality-reduction-%E9%99%8D%E7%BB%B4/">Dimensionality reduction (降维)&lt;/a>&lt;/li>
&lt;li>&lt;a href="https://terms-en.ai-term-hub.com/en/terms/sparse-matrix-%E7%A8%80%E7%96%8F%E7%9F%A9%E9%98%B5/">Sparse matrix (稀疏矩阵)&lt;/a>&lt;/li>
&lt;/ul></description></item></channel></rss>