RのマシンラーニングGUIツールrattleパッケージをインストール

6583 ワード

これはRで機械で勉強する利器だ.
rattle()パッケージのインストール
> install.packages("rattle")
> library(rattle)
Rattle: A free graphical interface for data science with R.
XXXX 5.3.0 Copyright (c) 2006-2018 Togaware Pty Ltd.
  'rattle()'   、  、      。

rattleバッグの作者君はやんちゃだ
rattle()の実行
RGTk 2パッケージのインストール
> rattle()
Error in rattle() : 
The RGtk2 package is not available but is required. 
Please install the package using, for example: 

  install.packages("RGtk2")

> install.packages(RGtk2)
Error in install.packages : object 'RGtk2' not found
> install.packages("RGtk2")
trying URL 'https://mirrors.tongji.edu.cn/CRAN/bin/windows/contrib/3.6/RGtk2_2.20.36.zip'
Content type 'application/zip' length 16558916 bytes (15.8 MB)
downloaded 15.8 MB

package ‘RGtk2’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
    C:\Users\chang\AppData\Local\Temp\RtmpGibdaw\downloaded_packages

GTK+のインストール
rattle()の再起動
> rattle()
Loading required package: RGtk2
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'E:/R-3.6.2/library/RGtk2/libs/x64/RGtk2.dll':
  LoadLibrary failure:          。

私の機械にはGTKは入っていませんが、気にしないでください.Rattleはこの問題を発見して、直接私にGTK+をインストールするかどうかを聞いた.
正直に言うと、Rというパッケージ管理システムは本当に安心しています.何か必要なものがあれば、使うときに現装すればいいです.
trying URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Error: package or namespace load failed for ‘RGtk2’:
 .onLoad failed in loadNamespace() for 'RGtk2', details:
  call: download.file(dep_url, path, mode = "wb")
  error: cannot open URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Error in inDL(x, as.logical(local), as.logical(now), ...) : 
  unable to load shared object 'E:/R-3.6.2/library/RGtk2/libs/x64/RGtk2.dll':
  LoadLibrary failure:          。

In addition: Warning messages:
1: Failed to load RGtk2 dynamic library, attempting to install it. 
2: In download.file(dep_url, path, mode = "wb") :
  InternetOpenUrl failed: '               '
trying URL 'http://ftp.gnome.org/pub/gnome/binaries/win64/gtk+/2.22/gtk+-bundle_2.22.1-20101229_win64.zip'
Content type 'application/zip' length 25830230 bytes (24.6 MB)

ああ、このような洋人のサーバーとの関係は依然としてよくありません.私自身はhttp://ftp.gnome.org/pub/gnom...からインストールパッケージをダウンロードして、エラーメッセージの中のE:R-3.6を解凍しました.2 libraryRGTk 2 gtkx 64フォルダの中にあります.
In addition: Warning messages:
1: Failed to load RGtk2 dynamic library, attempting to install it. 
2: In download.file(dep_url, path, mode = "wb") :
  downloaded length 24694784 != reported length 25830230
3: In dir.create(gtk_path, recursive = TRUE) :
  'E:\R-3.6.2\library\RGtk2\gtk\x64' already exists
4: In unzip(path, exdir = gtk_path) : error 1 in extracting from zip file
5: In dir.create(config_path, recursive = TRUE) :
  'E:\R-3.6.2\library\RGtk2\gtk\x64\etc\gtk-2.0' already exists

rattleの起動
> rattle()
Loading required package: RGtk2

インストール成功
rattleによるデータマイニング
ケースデータをロードインディアン糖尿病データ
> diabetes  names(diabetes)  diabetes$class 

rattleの起動
> library(rattle)
> rattle()
  • Dataページ
  • データソースの選択:Rデータセット
  • Data Name選択diabetesデータセット
  • Partitionをチェックし、トレーニングセット、検証セット、テストセットの割合をデフォルトの70%、15%、15%、ランダムシード42
  • に設定します.
  • 実行ボタン
  • 結果
    Partitionを変更すると、トレーニングセット、検証セット、テストセットの割合はデフォルトの70%、30%、0%、ランダムシード42に従います.実行ボタン
  • 点Modelページ
  • タイプ選択Tree決定ツリー
  • 選択Conditional
  • 実行ボタン
  • 結果は次のとおりです.
    結果は出ませんでしたが、新聞を間違えたので・・・
    Multicompパッケージのインストール
    システムは間違って報告して、multcompを少なく包みますと言います
    Error: package or namespace load failed for ‘party’ in loadNamespace(j 

    もともと難しくないと思って、直接取り付けました
    > install.packages("multcomp")
    
     There is a binary version available but the source version is later:
            binary source needs_compilation
    multcomp 1.4-11 1.4-12             FALSE
    
    installing the source package ‘multcomp’
    
    trying URL 'https://mirrors.tongji.edu.cn/CRAN/src/contrib/multcomp_1.4-12.tar.gz'
    Warning in install.packages :
     cannot open URL 'https://mirrors.tongji.edu.cn/CRAN/src/contrib/multcomp_1.4-12.tar.gz': HTTP status was '404 Not Found'
    Error in download.file(url, destfile, method, mode = "wb", ...) : 
     cannot open URL 'https://mirrors.tongji.edu.cn/CRAN/src/contrib/multcomp_1.4-12.tar.gz'
    Warning in install.packages :
     download of package ‘multcomp’ failed

    同済大学のミラーにこのバッグが入っていないなんて...
    Rguiから入り、直接取り付け、蘭州ラーメンミラーを選びます.ちょっと待って、できます.
    > install.packages("multcomp")
    ---           CRAN    ---
      URL’https://mirror.lzu.edu.cn/CRAN/bin/windows/contrib/3.6/multcomp_1.4-12.zip'
    Content type 'application/zip' length 736891 bytes (719 KB)
    downloaded 719 KB
    
       ‘multcomp’    ,MD5      
    
              
           C:\Users\chang\AppData\Local\Temp\RtmpOUfyRk\downloaded_packages 

    #決定ツリー-条件推定ツリー
    パラメータを調整して、決定ツリーの変形条件推定ツリーをもう一度実行します.
    スムーズな運用
    結果は悪くない
    Summary of the Conditional Tree model for XXXX (built using 'ctree'):
    
        Conditional inference tree with 6 terminal nodes
    
    Response:  class 
    Inputs:  npregant, plasma, bp, triceps, insulin, bmi, pedigree, age 
    Number of observations:  537 
    
    1) plasma <= 127; criterion = 1, statistic = 122.668
     2) age <= 28; criterion = 1, statistic = 19.178
       3) pedigree <= 0.493; criterion = 0.984, statistic = 9.494
         4)*  weights = 128 
       3) pedigree > 0.493
         5)*  weights = 60 
     2) age > 28
       6)*  weights = 148 
    1) plasma > 127
     7) plasma <= 165; criterion = 1, statistic = 20.664
       8) bmi <= 29.9; criterion = 0.999, statistic = 14.334
         9)*  weights = 55 
       8) bmi > 29.9
         10)*  weights = 91 
     7) plasma > 165
       11)*  weights = 55 
    
    Time taken: 0.03 secs
    
    Rattle timestamp: 2020-02-02 17:20:50 chang
    ======================================================================

    点描画ボタン
    この図は直接きれいに描かれていないが,醜くもない.
    次は評価ページをご覧ください
    読むことに感謝して、関心と伝言を歓迎します>読むことに感謝して、関心と伝言を歓迎します
    量子化投資と先物外貨散逸、基金保険レベルも手に入れた.