首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >编译See5 / C50 GPL版

编译See5 / C50 GPL版
EN

Data Science用户
提问于 2019-03-14 16:00:30
回答 1查看 66关注 0票数 1

See5 / C5.0是从规则任务获得的数据挖掘工具

我希望为Linux编译C50,最好是为CentOS 6.x编译,但我无法编译。我也尝试过Ubuntu,但在那里也没有成功。

运行时提取后,我从C5.0版本2.07 GPL版下载了C50.tgz。/Makefile在Ubuntu18上给出了下面的错误

代码语言:javascript
复制
./Makefile: line 9: CC: command not found
./Makefile: line 10: CFLAGS: command not found
./Makefile: line 11: S: command not found
./Makefile: line 11: LFLAGS: command not found
./Makefile: line 12: SHELL: command not found
./Makefile: line 19: src: command not found
./Makefile: line 48: obj: command not found
./Makefile: line 59: all:: command not found
cat defns.i global.c c50.c construct.c formtree.c info.c discr.c contin.c subset.c prune.c p-thresh.c trees.c siftrules.c ruletree.c rules.c getdata.c implicitatt.c mcost.c confmat.c sort.c update.c attwinnow.c classify.c formrules.c getnames.c modelfiles.c utility.c xval.c\
        | egrep -v 'defns.i|extern.i' >c50gt.c
make: /bin/csh: Command not found
Makefile:75: recipe for target 'c5.0' failed
make: *** [c5.0] Error 127
./Makefile: line 61: CC: command not found
./Makefile: line 61: LFLAGS: command not found
./Makefile: line 61: -o: command not found
./Makefile: line 67: obj: command not found
./Makefile: line 67: c5.0dbg:: command not found
./Makefile: line 68: CC: command not found
./Makefile: line 68: obj: command not found
./Makefile: line 68: -g: command not found
./Makefile: line 74: src: command not found
./Makefile: line 74: c5.0:: command not found
./Makefile: line 75: src: command not found
./Makefile: line 77: CC: command not found
./Makefile: line 77: LFLAGS: command not found
./Makefile: line 77: -O3: command not found
strip: 'c5.0': No such file
./Makefile: line 82: obj: command not found
./Makefile: line 85: .c.o:: command not found
./Makefile: line 86: syntax error near unexpected token `newline'
./Makefile: line 86: `  (CC) #qcStackCode#(CFLAGS) -c A2lt;'

如果我运行make命令,它会给出以下错误。

代码语言:javascript
复制
make c5.0 
make: /bin/csh: Command not found Makefile:60: recipe for
target 'all' failed make: *** [all] Error 127

gcc版本是:

代码语言:javascript
复制
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0
EN

回答 1

Data Science用户

回答已采纳

发布于 2019-03-15 06:59:21

提取C50.tgz文件后,将执行权限授予Makefile

代码语言:javascript
复制
chmod +x Makefile

然后安装csh

代码语言:javascript
复制
sudo apt install csh

运行下面的命令以检查csh是否已安装,并检查csh版本(如果已安装)

代码语言:javascript
复制
dpkg -l csh

它应该像下面这样显示输出。

代码语言:javascript
复制
Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                           Version              Architecture         Description
+++-==============================-====================-====================-==================================================================
ii  csh                            20110502-3           amd64                Shell with C-like syntax

现在按照命令运行。

代码语言:javascript
复制
./Makefile

它应该给出如下的输出。(忽略警告消息)。

代码语言:javascript
复制
./Makefile: line 9: CC: command not found
./Makefile: line 10: CFLAGS: command not found
./Makefile: line 11: S: command not found
./Makefile: line 11: LFLAGS: command not found
./Makefile: line 12: SHELL: command not found
./Makefile: line 19: src: command not found
./Makefile: line 48: obj: command not found
./Makefile: line 59: all:: command not found
cat defns.i global.c c50.c construct.c formtree.c info.c discr.c contin.c subset.c prune.c p-thresh.c trees.c siftrules.c ruletree.c rules.c g     etdata.c implicitatt.c mcost.c confmat.c sort.c update.c attwinnow.c classify.c formrules.c getnames.c modelfiles.c utility.c xval.c\
        | egrep -v 'defns.i|extern.i' >c50gt.c
gcc -ffloat-store  -O3 -o c5.0 c50gt.c -lm
c50gt.c: In function ‘ListAttsUsed’:
c50gt.c:14025:12: warning: cast from pointer to integer of different size [-Wpointer-to-int-cast]
      Att = (Attribute) DefSVal(D[e]);
            ^
c50gt.c: In function ‘Error’:
c50gt.c:15561:17: warning: format not a string literal and no format arguments [-Wformat-security]
     fprintf(Of, Buffer);
                 ^~~~~~
strip c5.0
rm c50gt.c
./Makefile: line 61: CC: command not found
./Makefile: line 61: LFLAGS: command not found
./Makefile: line 61: -o: command not found
./Makefile: line 67: obj: command not found
./Makefile: line 67: c5.0dbg:: command not found
./Makefile: line 68: CC: command not found
./Makefile: line 68: obj: command not found
./Makefile: line 68: -g: command not found
./Makefile: line 74: src: command not found
./Makefile: line 74: c5.0:: command not found
./Makefile: line 75: src: command not found
./Makefile: line 77: CC: command not found
./Makefile: line 77: LFLAGS: command not found
./Makefile: line 77: -O3: command not found
./Makefile: line 82: obj: command not found
./Makefile: line 85: .c.o:: command not found
./Makefile: line 86: syntax error near unexpected token `newline'
./Makefile: line 86: `  (CC) #qcStackCode#(CFLAGS) -c A7lt;'

您将看到一个新的文件c5.0*检查命令行选项和下面的命令。

代码语言:javascript
复制
./c5.0 -h

它应该显示在输出下面。

代码语言:javascript
复制
C5.0 [Release 2.07 GPL Edition]         Fri Mar 15 17:43:39 2019
-------------------------------

    Options:
        -f <filestem>   application filestem
        -r              use rule-based classifiers
        -u <bands>      order rules by utility in bands
        -w              invoke attribute winnowing
        -b              invoke boosting
        -t <trials>     number of boosting trials
        -p              use soft thresholds
        -e              focus on errors (ignore costs file)
        -s              find subset tests for discrete atts
        -g              do not use global tree pruning
        -m <cases>      restrict allowable splits
        -c <percent>    confidence level (CF) for pruning
        -S <percent>    training sample percentage
        -X <folds>      cross-validate
        -I <integer>    random seed for sampling and cross-validation
        -h              print this message

现在,C50已经准备好使用了。下面是一个示例命令(假设sampledata.data和sampledata.names文件存在于同一个文件夹中)。

代码语言:javascript
复制
./c5.0 -r -f sampledata

成功执行命令后,将在同一个文件夹中生成sampledata.rules。

请参阅这里的完整教程

票数 0
EN
页面原文内容由Data Science提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://datascience.stackexchange.com/questions/47309

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档