See5 / C5.0是从规则任务获得的数据挖掘工具
我希望为Linux编译C50,最好是为CentOS 6.x编译,但我无法编译。我也尝试过Ubuntu,但在那里也没有成功。
运行时提取后,我从C5.0版本2.07 GPL版下载了C50.tgz。/Makefile在Ubuntu18上给出了下面的错误
./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命令,它会给出以下错误。
make c5.0
make: /bin/csh: Command not found Makefile:60: recipe for
target 'all' failed make: *** [all] Error 127gcc版本是:
gcc (Ubuntu 7.3.0-27ubuntu1~18.04) 7.3.0发布于 2019-03-15 06:59:21
提取C50.tgz文件后,将执行权限授予Makefile。
chmod +x Makefile然后安装csh
sudo apt install csh运行下面的命令以检查csh是否已安装,并检查csh版本(如果已安装)
dpkg -l csh它应该像下面这样显示输出。
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现在按照命令运行。
./Makefile它应该给出如下的输出。(忽略警告消息)。
./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*检查命令行选项和下面的命令。
./c5.0 -h它应该显示在输出下面。
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文件存在于同一个文件夹中)。
./c5.0 -r -f sampledata成功执行命令后,将在同一个文件夹中生成sampledata.rules。
请参阅这里的完整教程
https://datascience.stackexchange.com/questions/47309
复制相似问题