安装软件包格莱学示例构建,在 /家/名称/tmp/ 中git clone https://github.com/sjwhitworth/golearn.gitcd golearn/ ## Completing the installation ## Run the following to complete installationgo get -t -u -v ./...使用:请(也)阅读 README.md 的文本文件。
golearn的指令可能有些过时,你可以按照我的流程:cd到一个空的文件夹中,就像 一样,下面的所有命令都应该在这个 floder 上运行/home/your/code/my_golearn运行初始化一个 go 项目,你会得到一个文件go mod init my_golearngo.mod创建一个文件,并用 https://github.com/sjwhitworth/golearn#getting-started 的代码填充它main.go跑go get github.com/sjwhitworth/golearn运行以获取所有依赖项go mod download运行,这很奇怪,但是如果这个命令错过了就不起作用了,我想也许golearn的开发人员对go mod有一些误用go get github.com/sjwhitworth/golearn/knn运行以获取所需的数据集wget https://raw.githubusercontent.com/sjwhitworth/golearn/master/examples/datasets/iris.csv -P datasets运行 ,您将获得与 https://github.com/sjwhitworth/golearn#getting-started 相同的结果go run ./main.go如果您不熟悉如何在现代围棋项目中安装依赖项,最好先了解 https://go.dev/blog/using-go-modules