文件名称:R语言lightGBM包Win10下编译可用
文件大小:1.75MB
文件格式:ZIP
更新时间:2021-04-06 07:11:56
R语言 lightGBM
R语言在win10下编译的lightGBM扩展包。 > sessionInfo() R version 3.4.3 (2017-11-30) Platform: x86_64-w64-mingw32/x64 (64-bit) Running under: Windows >= 8 x64 (build 9200) Matrix products: default locale: [1] LC_COLLATE=Chinese (Simplified)_China.936 [2] LC_CTYPE=Chinese (Simplified)_China.936 [3] LC_MONETARY=Chinese (Simplified)_China.936 [4] LC_NUMERIC=C [5] LC_TIME=Chinese (Simplified)_China.936 attached base packages: [1] stats graphics grDevices utils datasets methods [7] base other attached packages: [1] lightgbm_2.1.0 R6_2.2.2 loaded via a namespace (and not attached): [1] compiler_3.4.3 magrittr_1.5 tools_3.4.3 [4] yaml_2.1.18 data.table_1.10.4-3 > require(lightgbm) Loading required package: lightgbm Loading required package: R6 > data(iris) > iris$Species <- as.numeric(as.factor(iris$Species)) - 1 > train <- as.matrix(iris[c(1:40, 51:90, 101:140), ]) > test <- as.matrix(iris[c(41:50, 91:100, 141:150), ]) > dtrain <- lgb.Dataset(data = train[, 1:4], label = train[, 5]) > dtest <- lgb.Dataset.create.valid(dtrain, data = test[, 1:4], label = test[, 5]) > valids <- list(test = dtest) > params <- list(objective = "multiclass", metric = "multi_error", num_class = 3) > model <- lgb.train(params, + dtrain, + 100, + valids, + min_data = 1, + learning_rate = 1, + early_stopping_rounds = 10) [LightGBM] [Info] Total Bins 87 [LightGBM] [Info] Number of data: 120, number of used features: 4 [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [LightGBM] [Warning] No further splits with positive gain, best gain: -inf [1]: test's multi_error:0.0333333 > my_preds <- predict(model, test[, 1:4]) > > head(my_preds) [1] 0.82590130 0.08704935 0.08704935 0.82590130 0.08704935 0.08704935 >
【文件预览】:
lightgbm
----Meta()
--------demo.rds(351B)
--------Rd.rds(1KB)
--------nsInfo.rds(539B)
--------features.rds(112B)
--------package.rds(1KB)
--------links.rds(582B)
--------data.rds(152B)
--------hsearch.rds(1KB)
----NAMESPACE(1KB)
----DESCRIPTION(1KB)
----R()
--------lightgbm.rdb(54KB)
--------lightgbm(1KB)
--------lightgbm.rdx(1KB)
----html()
--------lgb.prepare_rules2.html(4KB)
--------lgb.Dataset.html(2KB)
--------lgb.Dataset.set.categorical.html(2KB)
--------lgb.Dataset.create.valid.html(2KB)
--------saveRDS.lgb.Booster.html(3KB)
--------agaricus.test.html(2KB)
--------lgb.prepare_rules.html(4KB)
--------R.css(1KB)
--------lgb.train.html(11KB)
--------lgb.Dataset.construct.html(1KB)
--------predict.lgb.Booster.html(3KB)
--------lgb.Dataset.set.reference.html(2KB)
--------getinfo.html(2KB)
--------setinfo.html(2KB)
--------lgb.model.dt.tree.html(3KB)
--------lgb.plot.importance.html(3KB)
--------readRDS.lgb.Booster.html(2KB)
--------slice.html(2KB)
--------lgb.dump.html(2KB)
--------lgb.get.eval.result.html(2KB)
--------00Index.html(6KB)
--------dimnames.lgb.Dataset.html(2KB)
--------lgb.unloader.html(3KB)
--------lgb.save.html(2KB)
--------lgb.load.html(2KB)
--------lgb.Dataset.save.html(1KB)
--------lgb.plot.interpretation.html(3KB)
--------lgb.importance.html(2KB)
--------bank.html(1KB)
--------agaricus.train.html(2KB)
--------lgb.interprete.html(3KB)
--------dim.html(2KB)
--------lgb.prepare.html(3KB)
--------lgb.prepare2.html(3KB)
----help()
--------lightgbm.rdb(68KB)
--------paths.rds(441B)
--------lightgbm.rdx(865B)
--------aliases.rds(401B)
--------AnIndex(1KB)
----demo()
--------categorical_features_rules.R(4KB)
--------multiclass.R(2KB)
--------early_stopping.R(2KB)
--------leaf_stability.R(7KB)
--------boost_from_prediction.R(1KB)
--------basic_walkthrough.R(5KB)
--------cross_validation.R(2KB)
--------weight_param.R(4KB)
--------efficient_many_training.R(1KB)
--------categorical_features_prepare.R(3KB)
----INDEX(2KB)
----LICENSE(1KB)
----libs()
--------x64()
----data()
--------agaricus.test.rda(15KB)
--------agaricus.train.rda(56KB)
--------bank.rda(57KB)
----tests()
--------testthat()
--------testthat.R(64B)