SKLearn - Biclustering

文章目錄

  • Biclustering (雙聚類)
  • 譜二分聚類算法演示
    • 生成樣本數據
    • 擬合 `SpectralBiclustering`
    • 繪制結果
  • Spectral Co-Clustering 算法演示
  • 使用光譜協同聚類算法進行文檔的二分聚類


Biclustering (雙聚類)

關于雙聚類技術的示例。


雙聚類算法演示


譜雙聚類的演示

譜雙聚類的演示
譜協同聚類算法演示


使用譜協同聚類算法對文檔進行雙聚類

使用譜協同聚類算法對文檔進行雙聚類
新聞組文檔的雙聚類


使用譜協同聚類算法對新聞組文檔進行雙聚類

使用譜協同聚類算法對新聞組文檔進行雙聚類


注意:前往末尾下載完整示例代碼或通過 JupyterLite 或 Binder 在瀏覽器中運行此示例。


譜二分聚類算法演示

本例演示了如何使用 SpectralBiclustering 算法生成方格數據集并對其進行二分聚類。譜二分聚類算法專門設計用于通過同時考慮矩陣的行(樣本)和列(特征)來聚類數據。它的目標是識別樣本之間以及樣本子集中的模式,從而在數據中檢測到局部化結構。這使得譜二分聚類特別適合于特征順序或排列固定的數據集,例如圖像、時間序列或基因組。

數據生成后,經過打亂并傳遞給譜二分聚類算法。然后重新排列打亂矩陣的行和列來繪制找到的二分聚類。


# 作者:scikit-learn 開發者
# SPDX-License-Identifier: BSD-3-Clause

生成樣本數據

我們使用 make_checkerboard 函數生成樣本數據。shape=(300, 300) 中的每個像素都代表來自均勻分布的值。噪聲來自正態分布,其中 noise 的值是標準差。

如您所見,數據分布在 12 個簇單元中,且相對容易區分。

from matplotlib import pyplot as pltfrom sklearn.datasets import make_checkerboardn_clusters = (4, 3)
data, rows, columns = make_checkerboard(shape=(300, 300), n_clusters=n_clusters, noise=10, shuffle=False, random_state=42
)plt.matshow(data, cmap=plt.cm.Blues)
plt.title("原始數據集")
plt.show()

原始數據集


我們打亂數據,目標是之后使用 SpectralBiclustering 重建它。

import numpy as np# 創建打亂行和列索引的列表
rng = np.random.RandomState(0)
row_idx_shuffled = rng.permutation(data.shape[0])
col_idx_shuffled = rng.permutation(data.shape[1])

我們重新定義打亂的數據并繪制它。我們觀察到我們失去了原始數據矩陣的結構。

data = data[row_idx_shuffled][:, col_idx_shuffled]plt.matshow(data, cmap=plt.cm.Blues)
plt.title("打亂的數據集")
plt.show()

打亂的數據集


擬合 SpectralBiclustering

我們擬合模型并比較獲得的聚類與真實值。請注意,在創建模型時,我們指定了與創建數據集時相同的簇數(n_clusters = (4, 3)),這將有助于獲得良好的結果。

from sklearn.cluster import SpectralBiclustering
from sklearn.metrics import consensus_scoremodel = SpectralBiclustering(n_clusters=n_clusters, method="log", random_state=0)
model.fit(data)# 計算兩組二分聚類之間的相似度
score = consensus_score(model.biclusters_, (rows[:, row_idx_shuffled], columns[:, col_idx_shuffled]))
print(f"一致性得分:{score:.1f}")
***
一致性得分:1.0

該得分介于 0 和 1 之間,其中 1 對應于完美的匹配。它顯示了二分聚類的質量。


繪制結果

現在,我們根據 SpectralBiclustering 模型分配的行和列標簽按升序重新排列數據,并再次繪制。row_labels_ 的范圍從 0 到 3,而 column_labels_ 的范圍從 0 到 2,代表每行有 4 個簇,每列有 3 個簇。

# 首先重新排列行,然后是列。
reordered_rows = data[np.argsort(model.row_labels_)]
reordered_data = reordered_rows[:, np.argsort(model.column_labels_)]plt.matshow(reordered_data, cmap=plt.cm.Blues)
plt.title("二分聚類后;重新排列以顯示二分聚類")
plt.show()

二分聚類后;重新排列以顯示二分聚類


最后一步,我們想展示模型分配的行和列標簽之間的關系。因此,我們使用 numpy.outer 創建一個網格,它將排序后的 row_labels_column_labels_ 相加 1,以確保標簽從 1 開始而不是 0,以便更好地可視化。

plt.matshow(np.outer(np.sort(model.row_labels_) + 1, np.sort(model.column_labels_) + 1), cmap=plt.cm.Blues)
plt.title("重新排列數據的方格結構")
plt.show()

重新排列數據的方格結構


行和列標簽向量的外積顯示了方格結構的表示,其中不同的行和列標簽組合用不同的藍色陰影表示。

腳本的總運行時間:(0 分鐘 0.534 秒)


  • 啟動 binder : https://mybinder.org/v2/gh/scikit-learn/scikit-learn/1.6.X?urlpath=lab/tree/notebooks/auto_examples/bicluster/plot_spectral_biclustering.ipynb
  • 啟動 JupyterLite : https://scikit-learn.org/stable/lite/lab/index.html?path=auto_examples/bicluster/plot_spectral_biclustering.ipynb
  • 下載 Jupyter notebook:`plot_spectral_biclustering.ipynb](https://scikit-learn.org/stable/_downloads//6b00e458f3e282f1cc421f077b2fcad1/plot_spectral_biclustering.ipynb>
  • 下載 Python 源代碼:plot_spectral_biclustering.py : https://scikit-learn.org/stable/_downloads//ac19db97f4bbd077ccffef2736ed5f3d/plot_spectral_biclustering.py
  • 下載 zip 文件:plot_spectral_biclustering.zip: <https://scikit-learn.org/stable/_downloads//f66c3a9f3631c05c52d31172371922ab/plot_spectral_biclustering.zip`

Spectral Co-Clustering 算法演示

本例演示了如何使用 Spectral Co-Clustering 算法生成數據集并對其進行二分聚類。

數據集使用 make_biclusters 函數生成,該函數創建一個包含小值的矩陣,并植入具有大值的大值二分塊。然后,行和列進行洗牌,并傳遞給 Spectral Co-Clustering 算法。通過重新排列洗牌后的矩陣以顯示連續的二分塊,展示了算法找到二分塊的高準確性。

  • 原始數據集

  • 洗牌后的數據集

  • 二分聚類后;重新排列以顯示二分塊

一致性得分:1.000

# 作者:scikit-learn 開發者
# SPDX-License-Identifier: BSD-3-Clauseimport numpy as np
from matplotlib import pyplot as pltfrom sklearn.cluster import [SpectralCoclustering](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.SpectralCoclustering.html#sklearn.cluster.SpectralCoclustering "sklearn.cluster.SpectralCoclustering")
from sklearn.datasets import [make_biclusters](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_biclusters.html#sklearn.datasets.make_biclusters "sklearn.datasets.make_biclusters")
from sklearn.metrics import [consensus_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.consensus_score.html#sklearn.metrics.consensus_score "sklearn.metrics.consensus_score")data, rows, columns = [make_biclusters](https://scikit-learn.org/stable/modules/generated/sklearn.datasets.make_biclusters.html#sklearn.datasets.make_biclusters "sklearn.datasets.make_biclusters")(shape=(300, 300), n_clusters=5, noise=5, shuffle=False, random_state=0
)[plt.matshow](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.matshow.html#matplotlib.pyplot.matshow "matplotlib.pyplot.matshow")(data, cmap=plt.cm.Blues)
[plt.title](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.title.html#matplotlib.pyplot.title "matplotlib.pyplot.title")("原始數據集")# 洗牌聚類
rng = [np.random.RandomState](https://numpy.org/doc/stable/reference/random/legacy.html#numpy.random.RandomState "numpy.random.RandomState")(0)
row_idx = rng.permutation(data.shape[0])
col_idx = rng.permutation(data.shape[1])
data = data[row_idx][:, col_idx][plt.matshow](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.matshow.html#matplotlib.pyplot.matshow "matplotlib.pyplot.matshow")(data, cmap=plt.cm.Blues)
[plt.title](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.title.html#matplotlib.pyplot.title "matplotlib.pyplot.title")("洗牌后的數據集")model = [SpectralCoclustering](https://scikit-learn.org/stable/modules/generated/sklearn.cluster.SpectralCoclustering.html#sklearn.cluster.SpectralCoclustering "sklearn.cluster.SpectralCoclustering")(n_clusters=5, random_state=0)
model.fit(data)
score = [consensus_score](https://scikit-learn.org/stable/modules/generated/sklearn.metrics.consensus_score.html#sklearn.metrics.consensus_score "sklearn.metrics.consensus_score")(model.biclusters_, (rows[:, row_idx], columns[:, col_idx]))print("一致性得分:{:.3f}".format(score))fit_data = data[[np.argsort](https://numpy.org/doc/stable/reference/generated/numpy.argsort.html#numpy.argsort "numpy.argsort")(model.row_labels_)]
fit_data = fit_data[:, [np.argsort](https://numpy.org/doc/stable/reference/generated/numpy.argsort.html#numpy.argsort "numpy.argsort")(model.column_labels_)][plt.matshow](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.matshow.html#matplotlib.pyplot.matshow "matplotlib.pyplot.matshow")(fit_data, cmap=plt.cm.Blues)
[plt.title](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.title.html#matplotlib.pyplot.title "matplotlib.pyplot.title")("二分聚類后;重新排列以顯示二分塊")[plt.show](https://matplotlib.org/stable/api/_as_gen/matplotlib.pyplot.show.html#matplotlib.pyplot.show "matplotlib.pyplot.show")()

腳本的總運行時間: (0 分鐘 0.347 秒)

  • 啟動 binder : https://mybinder.org/v2/gh/scikit-learn/scikit-learn/1.6.X?urlpath=lab/tree/notebooks/auto_examples/bicluster/plot_spectral_coclustering.ipynb
  • 啟動 JupyterLite : https://scikit-learn.org/stable/lite/lab/index.html?path=auto_examples/bicluster/plot_spectral_coclustering.ipynb
  • 下載 Jupyter notebook:`plot_spectral_coclustering.ipynb](https://scikit-learn.org/stable/_downloads//ee8e74bb66ae2967f890e19f28090b37/plot_spectral_coclustering.ipynb>
  • 下載 Python 源代碼:plot_spectral_coclustering.py : https://scikit-learn.org/stable/_downloads//bc8849a7cb8ea7a8dc7237431b95a1cc/plot_spectral_coclustering.py
  • 下載 zip 文件:plot_spectral_coclustering.zip: <https://scikit-learn.org/stable/_downloads//3019a99f3f124514f9a0650bcb33fa27/plot_spectral_coclustering.zip`


使用光譜協同聚類算法進行文檔的二分聚類

本例展示了如何使用光譜協同聚類算法對二十個新聞組數據集進行處理。由于“comp.os.ms-windows.misc”類別包含大量僅包含數據的帖子,因此該類別被排除。

TF-IDF 向量化后的帖子形成了一個詞頻矩陣,然后使用 Dhillon 的光譜協同聚類算法進行二分聚類。結果文檔-詞二分聚類表示了那些子文檔中更常用的一些子詞。

對于一些最好的二分聚類,打印出其最常見的文檔類別和十個最重要的詞。最好的二分聚類是由其歸一化切割確定的。最好的詞是通過比較其在二分聚類內外部的和來確定的。

為了比較,文檔還使用 MiniBatchKMeans 進行了聚類。從二分聚類中得到的文檔簇比 MiniBatchKMeans 找到的簇的 V-measure 更好。

向量化...
協同聚類...
完成耗時 1.20 秒。V-measure: 0.4415
MiniBatchKMeans...
完成耗時 2.28 秒。V-measure: 0.3015最佳二分聚類:
----------------
二分聚類 0 : 8 個文檔,6 個詞
類別   : 100% talk.politics.mideast
詞        : cosmo, angmar, alfalfa, alphalpha, proline, benson二分聚類 1 : 1948 個文檔,4325 個詞
類別   : 23% talk.politics.guns, 18% talk.politics.misc, 17% sci.med
詞        : gun, guns, geb, banks, gordon, clinton, pitt, cdt, surrender, veal二分聚類 2 : 1259 個文檔,3534 個詞
類別   : 27% soc.religion.christian, 25% talk.politics.mideast, 25% alt.atheism
詞        : god, jesus, christians, kent, sin, objective, belief, christ, faith, moral二分聚類 3 : 775 個文檔,1623 個詞
類別   : 30% comp.windows.x, 25% comp.sys.ibm.pc.hardware, 20% comp.graphics
詞        : scsi, nada, ide, vga, esdi, isa, kth, s3, vlb, bmug二分聚類 4 : 2180 個文檔,2802 個詞
類別   : 18% comp.sys.mac.hardware, 16% sci.electronics, 16% comp.sys.ibm.pc.hardware
詞        : voltage, shipping, circuit, receiver, processing, scope, mpce, analog, kolstad, umass

# Authors: The scikit-learn developers
# SPDX-License-Identifier: BSD-3-Clause
from collections import Counter
from time import timeimport numpy as npfrom sklearn.cluster import MiniBatchKMeans, SpectralCoclustering
from sklearn.datasets import fetch_20newsgroups
from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.metrics.cluster import v_measure_scoredef number_normalizer(tokens):"""將所有數字標記映射到占位符。對于許多應用,以數字開頭的標記不是直接有用的,但這樣的標記存在的事實可能很重要。通過應用這種形式的降維,某些方法可能表現得更好。"""return ("#NUMBER" if token[0].isdigit() else token for token in tokens)class NumberNormalizingVectorizer(TfidfVectorizer):def build_tokenizer(self):tokenize = super().build_tokenizer()return lambda doc: list(number_normalizer(tokenize(doc)))# 排除 'comp.os.ms-windows.misc'
categories = ["alt.atheism", "comp.graphics", "comp.sys.ibm.pc.hardware", "comp.sys.mac.hardware", "comp.windows.x", "misc.forsale", "rec.autos", "rec.motorcycles", "rec.sport.baseball", "rec.sport.hockey", "sci.crypt", "sci.electronics", "sci.med", "sci.space", "soc.religion.christian", "talk.politics.guns", "talk.politics.mideast", "talk.politics.misc", "talk.religion.misc", ]
newsgroups = fetch_20newsgroups(categories=categories)
y_true = newsgroups.targetvectorizer = NumberNormalizingVectorizer(stop_words="english", min_df=5)
cocluster = SpectralCoclustering(n_clusters=len(categories), svd_method="arpack", random_state=0
)
kmeans = MiniBatchKMeans(n_clusters=len(categories), batch_size=20000, random_state=0, n_init=3
)print("向量化...")
X = vectorizer.fit_transform(newsgroups.data)print("協同聚類...")
start_time = time()
cocluster.fit(X)
y_cocluster = cocluster.row_labels_
print(f"完成耗時 {time() - start_time:.2f}s. V-measure: {v_measure_score(y_cocluster, y_true):.4f}"
)print("MiniBatchKMeans...")
start_time = time()
y_kmeans = kmeans.fit_predict(X)
print(f"完成耗時 {time() - start_time:.2f}s. V-measure: {v_measure_score(y_kmeans, y_true):.4f}"
)feature_names = vectorizer.get_feature_names_out()
document_names = list(newsgroups.target_names[i] for i in newsgroups.target)def bicluster_ncut(i):rows, cols = cocluster.get_indices(i)if not (np.any(rows) and np.any(cols)):import sysreturn sys.float_info.maxrow_complement = np.nonzero(np.logical_not(cocluster.rows_[i]))[0]col_complement = np.nonzero(np.logical_not(cocluster.columns_[i]))[0]# 注意:以下與 X[rows[:, np.newaxis], cols].sum() 相同,但在 scipy <= 0.16 中更快weight = X[rows][:, cols].sum()cut = X[row_complement][:, cols].sum() + X[rows][:, col_complement].sum()return cut / weightbicluster_ncuts = list(bicluster_ncut(i) for i in range(len(newsgroups.target_names)))
best_idx = np.argsort(bicluster_ncuts)[:5]print()
print("最佳二分聚類:")
print("----------------")
for idx, cluster in enumerate(best_idx):n_rows, n_cols = cocluster.get_shape(cluster)cluster_docs, cluster_words = cocluster.get_indices(cluster)if not len(cluster_docs) or not len(cluster_words):continue# 類別counter = Counter(document_names[doc] for doc in cluster_docs)cat_string = ", ".join(f"{(c / n_rows * 100):.0f}% {name}" for name, c in counter.most_common(3))# 詞out_of_cluster_docs = cocluster.row_labels_ != clusterout_of_cluster_docs = np.where(out_of_cluster_docs)[0]word_col = X[:, cluster_words]word_scores = np.array(word_col[cluster_docs, :].sum(axis=0)- word_col[out_of_cluster_docs, :].sum(axis=0))word_scores = word_scores.ravel()important_words = list(feature_names[cluster_words[i]] for i in word_scores.argsort()[:-11:-1])print(f"二分聚類 {idx} : {n_rows} 個文檔,{n_cols} 個詞")print(f"類別   : {cat_string}")print(f"詞        : {', '.join(important_words)}\n")

腳本的總運行時間: (0 分鐘 15.176 秒)

  • 啟動 binder : https://mybinder.org/v2/gh/scikit-learn/scikit-learn/1.6.X?urlpath=lab/tree/notebooks/auto_examples/bicluster/plot_bicluster_newsgroups.ipynb
  • 啟動 JupyterLite : https://scikit-learn.org/stable/lite/lab/index.html?path=auto_examples/bicluster/plot_bicluster_newsgroups.ipynb
  • 下載 Jupyter notebook: plot_bicluster_newsgroups.ipynb](https://scikit-learn.org/stable/_downloads//3f7191b01d0103d1886c959ed7687c4d/plot_bicluster_newsgroups.ipynb>
  • 下載 Python 源代碼: plot_bicluster_newsgroups.py` : https://scikit-learn.org/stable/_downloads//e68419b513284db108081422c73a5667/plot_bicluster_newsgroups.py
  • 下載 zip 文件: plot_bicluster_newsgroups.zip: <https://scikit-learn.org/stable/_downloads//ccd24a43e08ccb154430edf7f927cfc7/plot_bicluster_newsgroups.zip

本文來自互聯網用戶投稿,該文觀點僅代表作者本人,不代表本站立場。本站僅提供信息存儲空間服務,不擁有所有權,不承擔相關法律責任。
如若轉載,請注明出處:http://www.pswp.cn/bicheng/78629.shtml
繁體地址,請注明出處:http://hk.pswp.cn/bicheng/78629.shtml
英文地址,請注明出處:http://en.pswp.cn/bicheng/78629.shtml

如若內容造成侵權/違法違規/事實不符,請聯系多彩編程網進行投訴反饋email:809451989@qq.com,一經查實,立即刪除!

相關文章

PostSwigger Web 安全學習:CSRF漏洞2

CSRF 漏洞學習網站&#xff1a;What is CSRF (Cross-site request forgery)? Tutorial & Examples | Web Security Academy CSRF 漏洞&#xff1a;SameSite相關繞過 當瀏覽器訪問服務器時&#xff0c;服務器會在 Cookie 中添加 SameSite 屬性來告訴瀏覽器是否在來自其他…

從基礎到實戰的量化交易全流程學習:1.3 數學與統計學基礎——概率與統計基礎 | 數字特征

從基礎到實戰的量化交易全流程學習&#xff1a;1.3 數學與統計學基礎——概率與統計基礎 | 數字特征 第一部分&#xff1a;概率與統計基礎 第2節&#xff1a;數字特征&#xff1a;期望值、方差、協方差與相關系數 一、期望值&#xff08;Expected Value&#xff09;&#xff1a…

MySQL(聚合函數)

單行函數 對每一條記錄輸入值進行計算&#xff0c;得到相應的計算結果&#xff0c;返回給用戶&#xff0c;也就是說&#xff0c;每條記錄作為一個輸入參數&#xff0c;經過函數計算得到每條記錄的計算結果。 每一個函數中都有一些常用的函數&#xff08;方法&#xff09; 在學…

babel核心知識點

Babel 是一個 JavaScript 編譯器&#xff0c;主要用于將 ECMAScript 2015 版本的代碼轉換為向后兼容的 JavaScript 代碼&#xff0c;以便在舊版本的瀏覽器或環境中運行。以下是 Babel 的核心知識點&#xff1a; 1. 基本概念 編譯器&#xff1a;Babel 本質上是一個編譯器&…

javaScript--數據結構和算法

在 JavaScript 里&#xff0c;數據結構和算法是十分關鍵的部分&#xff0c;下面介紹幾種常見的數據結構和對應的算法。 數組&#xff08;Array&#xff09; 數組是最基礎的數據結構&#xff0c;用于存儲一系列有序的數據。 // 創建數組 const arr [1, 2, 3, 4, 5];// 訪問元素…

π0.5:帶開放世界泛化的視覺-語言-動作模型

25年4月來自具身機器人創業公司 PI 公司的論文“π0.5: a Vision-Language-Action Model with Open-World Generalization”。 為了使機器人發揮作用&#xff0c;它們必須在實驗室之外的現實世界中執行實際相關的任務。雖然視覺-語言-動作 (VLA) 模型在端到端機器人控制方面已…

使用 OpenCV 和 dlib 進行人臉檢測

文章目錄 1. 什么是 dlib2. 前期準備介紹2.1 環境準備2.2 dlib 的人臉檢測器 3. 代碼實現3.1 導入庫3.2 加載檢測器3.3 讀取并調整圖像大小3.4 檢測人臉3.5 繪制檢測框3.6 顯示結果 4. 完整代碼5. 優化與改進5.1 提高檢測率5.2 處理 BGR 與 RGB 問題 6. 總結 人臉檢測是計算機視…

spring 的PropertySource 類與 @PropertySource 注解詳解與對比

PropertySource 類與 PropertySource 注解詳解與對比 在這里插入圖片描述 一、PropertySource 類詳解 1. 類型與作用 類型&#xff1a;接口&#xff08;org.springframework.core.env.PropertySource&#xff09;作用&#xff1a;抽象配置數據源&#xff0c;提供統一的鍵值…

Java后端開發day37--源碼解析:TreeMap可變參數--集合工具類:Collections

&#xff08;以下內容全部來自上述課程&#xff09; 1. TreeMap 1.1 須知 1.1.1 Entry 節點初始為黑色&#xff1a;提高代碼閱讀性 1.1.2 TreeMap中的成員變量 comparator&#xff1a;比較規則root&#xff1a;紅黑樹根節點的地址值size&#xff1a;集合的長度和紅黑樹…

基于Playwright的瀏覽器自動化MCP服務

一、服務定位與核心功能 github.com/executeautomation/mcp-playwright 是一個基于 Playwright&#xff08;微軟開源的跨瀏覽器自動化測試框架&#xff09;的 Model Context Protocol (MCP) 服務&#xff0c;核心功能是將瀏覽器自動化能力集成到大語言模型&#xff08;LLM&…

OSPF網絡協議

OSPF&#xff08;Open Shortest Path First&#xff09;是一種鏈路狀態路由協議&#xff0c;屬于IGP&#xff08;內部網關協議&#xff09;&#xff0c;用于在單一自治系統&#xff08;AS&#xff09;內動態分發路由信息。它通過計算最短路徑&#xff08;基于Dijkstra算法&…

Ubuntu 22.04.4操作系統初始化詳細配置

上一章節&#xff0c;主要講解了Ubuntu 22.04.4操作系統的安裝&#xff0c;但是在實際生產環境中&#xff0c;需要對Ubuntu操作系統初始化&#xff0c;從而提高系統的性能和穩定性。 一、查看Ubuntu系統版本和內核版本 # 查看系統版本 testubuntu:~$ sudo lsb_release -a Rel…

【Linux應用】開發板快速上手:鏡像燒錄、串口shell、外設掛載、WiFi配置、SSH連接、文件交互(RADXA ZERO 3為例)

【Linux應用】開發板快速上手&#xff1a;鏡像燒錄、串口shell、外設掛載、WiFi配置、SSH連接、文件交互&#xff08;RADXA ZERO 3為例&#xff09; 參考&#xff1a; ZERO 3 | Radxa Docs 大部分的Linux開發板等設備都大同小異 如樹莓派、香橙派、STM32MP135的Linux開發板等 …

Redis使用總結

NoSQL 1.1為什么要用NoSQL 面對現在用戶數據的急劇上升&#xff0c;我們需要對這些用戶數據進行挖掘&#xff0c;傳統的關系型數據庫已經不適合這些 應用了.Nosql 的發展可以很了的處理這些大的數據. 1.2什么是NoSQL Not Only Sql->NoSQL(不僅僅是SQL) 非關系型數據庫.隨…

Unity ML-Agents + VScode 環境搭建 Windows

安裝Unity 先去官網下載Unity Hub&#xff0c;然后安裝在D盤就可以了&#xff0c;你需要手機上安裝一個Unity Connect進行賬號注冊。 詳細的注冊可以參考&#xff1a; https://blog.csdn.net/Dugege007/article/details/128472571 注冊好了以后登入電腦端的Unity Hub&#x…

Linux電源管理(2)_常規的電源管理的基本概念和軟件架構

原文&#xff1a; Linux電源管理(2)_Generic PM之基本概念和軟件架構 1. 前言 Linux系統中那些常規的電源管理手段&#xff0c;包括關機&#xff08;Power off&#xff09;、待機&#xff08;Standby or Hibernate&#xff09;、重啟&#xff08;Reboot&#xff09;等。這些…

機器學習基礎理論 - 分類問題評估指標

幾個定義:混淆矩陣 TP: True Positives, 表示實際為正例且被分類器判定為正例的樣本數FP: False Positives, 表示實際為負例且被分類器判定為正例的樣本數FN: False Negatives, 表示實際為正例但被分類器判定為負例的樣本數TN: True Negatives, 表示實際為負例且被分類…

在線教育系統開發常見問題及解決方案:源碼部署到運營維護

當下&#xff0c;越來越多的教育機構、企業培訓部門以及創業者&#xff0c;選擇開發屬于自己的在線教育系統。然而&#xff0c;從源碼部署到實際運營&#xff0c;整個過程中常常會遇到一系列技術與管理難題。今天&#xff0c;筆者將從在線教育系統源碼維護、運營等幾個方向為大…

RAG(Retrieval-Augmented Generation,檢索增強生成)

RAG&#xff08;Retrieval-Augmented Generation&#xff0c;檢索增強生成&#xff09;是一種結合 信息檢索 和 文本生成 的技術&#xff0c;旨在提升大語言模型&#xff08;LLM&#xff09;生成內容的準確性和時效性。其核心思想是&#xff1a;先檢索相關知識&#xff0c;再基…

項目實戰 -- 狀態管理

redux基礎 還記得好久好久之前就想要實現的一個功能嗎&#xff1f; 收起側邊欄折疊菜單&#xff0c;沒錯&#xff0c;現在才實現 因為不是父子通信&#xff0c;所以處理起來相對麻煩一點 可以使用狀態樹或者中間人模式 這就需要會redux了 Redux工作流&#xff1a; 異步就…