日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問 生活随笔!

生活随笔

當前位置: 首頁 > 编程资源 > 编程问答 >内容正文

编程问答

sklearn中digits手写字体数据集

發布時間:2023/12/10 编程问答 39 豆豆
生活随笔 收集整理的這篇文章主要介紹了 sklearn中digits手写字体数据集 小編覺得挺不錯的,現在分享給大家,幫大家做個參考.

1. 導入

from sklearn import datasets digits = datasets.load_digits()

2. 屬性查看

  • digits: bunch類型
print(digits.keys())dict_keys(['data', 'target', 'target_names', 'images', 'DESCR'])

3. 具體數據

  • 1797個樣本,每個樣本包括8*8像素的圖像和一個[0, 9]整數的標簽

3.1 images

  • ndarray類型,保存8*8的圖像,里面的元素是float64類型,共有1797張圖片
  • 用于顯示圖片
  • import matplotlib.pyplot as plt plt.imshow(digits.images[0])<matplotlib.image.AxesImage at 0x1676ca13ba8> plt.show()
  • ?

?

# 獲取第一張圖片 print(digits.images[0]) [[ 0. 0. 5. 13. 9. 1. 0. 0.][ 0. 0. 13. 15. 10. 15. 5. 0.][ 0. 3. 15. 2. 0. 11. 8. 0.][ 0. 4. 12. 0. 0. 8. 8. 0.][ 0. 5. 8. 0. 0. 9. 8. 0.][ 0. 4. 11. 0. 1. 12. 7. 0.][ 0. 2. 14. 5. 10. 12. 0. 0.][ 0. 0. 6. 13. 10. 0. 0. 0.]]
  • 或者

  • from skimage import io im=plt.imshow(digits.images[0]) print(type(im))<class 'matplotlib.image.AxesImage'> io.show()

?

3.2 data

  • ndarray類型,將images按行展開成一行,共有1797行
  • 輸入數據
  • print(digits.data[0]) [ 0. 0. 5. 13. 9. 1. 0. 0. 0. 0. 13. 15. 10. 15. 5.0. 0. 3. 15. 2. 0. 11. 8. 0. 0. 4. 12. 0. 0. 8.8. 0. 0. 5. 8. 0. 0. 9. 8. 0. 0. 4. 11. 0. 1.12. 7. 0. 0. 2. 14. 5. 10. 12. 0. 0. 0. 0. 6. 13.10. 0. 0. 0.]

3.3 target

  • ndarray類型,指明每張圖片的標簽,也就是每張圖片代表的數字
  • 輸出數據,標簽
  • print(digits.target[0])0

    3.4 target_names

  • ndarray類型,數據集中所有標簽值
  • print(digits.target_names) [0 1 2 3 4 5 6 7 8 9]

    3.5 DESCR

  • 數據集的描述,作者,數據來源等
  • print(digits.DESCR) .. _digits_dataset:Optical recognition of handwritten digits dataset --------------------------------------------------**Data Set Characteristics:**:Number of Instances: 5620:Number of Attributes: 64:Attribute Information: 8x8 image of integer pixels in the range 0..16.:Missing Attribute Values: None:Creator: E. Alpaydin (alpaydin '@' boun.edu.tr):Date: July; 1998This is a copy of the test set of the UCI ML hand-written digits datasets http://archive.ics.uci.edu/ml/datasets/Optical+Recognition+of+Handwritten+DigitsThe data set contains images of hand-written digits: 10 classes where each class refers to a digit.Preprocessing programs made available by NIST were used to extract normalized bitmaps of handwritten digits from a preprinted form. From a total of 43 people, 30 contributed to the training set and different 13 to the test set. 32x32 bitmaps are divided into nonoverlapping blocks of 4x4 and the number of on pixels are counted in each block. This generates an input matrix of 8x8 where each element is an integer in the range 0..16. This reduces dimensionality and gives invariance to small distortions.For info on NIST preprocessing routines, see M. D. Garris, J. L. Blue, G. T. Candela, D. L. Dimmick, J. Geist, P. J. Grother, S. A. Janet, and C. L. Wilson, NIST Form-Based Handprint Recognition System, NISTIR 5469, 1994... topic:: References- C. Kaynak (1995) Methods of Combining Multiple Classifiers and TheirApplications to Handwritten Digit Recognition, MSc Thesis, Institute ofGraduate Studies in Science and Engineering, Bogazici University.- E. Alpaydin, C. Kaynak (1998) Cascading Classifiers, Kybernetika.- Ken Tang and Ponnuthurai N. Suganthan and Xi Yao and A. Kai Qin.Linear dimensionalityreduction using relevance weighted LDA. School ofElectrical and Electronic Engineering Nanyang Technological University.2005.- Claudio Gentile. A New Approximate Maximal Margin ClassificationAlgorithm. NIPS. 2000.


    ? ? ? ? ? ? ? ? ? ??
    ? ??
    ? ? ?
    ? ? ? ??
    ? ? ? ? ? ? ? ? ? ? ? ??
    ? ? ? ? ? ? ? ??
    ?

?

?

?

?

?

?

?

總結

以上是生活随笔為你收集整理的sklearn中digits手写字体数据集的全部內容,希望文章能夠幫你解決所遇到的問題。

如果覺得生活随笔網站內容還不錯,歡迎將生活随笔推薦給好友。