Skip to content

Commit 7321460

Browse files
committed
Minor improvements in docstrings and crates.io tags
1 parent 2674e3c commit 7321460

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ repository = "https://github.com/Mottl/lightgbm3-rs"
88
description = "Rust bindings for LightGBM library"
99
documentation = "https://docs.rs/lightgbm3/"
1010
keywords = ["lightgbm", "machine-learning", "gradient-boosting"]
11-
categories = ["api-bindings"]
11+
categories = ["api-bindings", "science"]
1212
readme = "README.md"
1313
exclude = [".gitignore", ".github", ".gitmodules", "examples", "benches", "lightgbm3-sys"]
1414

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ bst.save_file("path/to/model.lgb").unwrap();
6262
use lightgbm3::{Dataset, Booster};
6363

6464
let bst = Booster::from_file("path/to/model.lgb").unwrap();
65-
let features = vec![1.0, 2.0, 33.0, -5.0];
65+
let features = vec![1.0, 2.0, -5.0];
6666
let n_features = features.len();
6767
let y_pred = bst.predict(&features, n_features as i32, true).unwrap()[0];
6868
```

lightgbm3-sys/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ build = "build.rs"
77
license = "MIT"
88
repository = "https://github.com/Mottl/lightgbm3-rs"
99
description = "Low-level Rust bindings for LightGBM library"
10+
categories = ["external-ffi-bindings"]
1011
readme = "README.md"
1112
exclude = ["README.md", ".gitlab-ci.yml", ".hgeol", ".gitignore", ".appveyor.yml", ".coveralls.yml", ".travis.yml", ".github", ".gitmodules", ".nuget", "**/*.md", "lightgbm/compute/doc", "lightgbm/compute/example", "lightgbm/compute/index.html", "lightgbm/compute/perf", "lightgbm/compute/test", "lightgbm/eigen/debug", "lightgbm/eigen/demos", "lightgbm/eigen/doc", "lightgbm/eigen/failtest", "lightgbm/eigen/test", "lightgbm/examples", "lightgbm/external_libs/fast_double_parser/benchmarks", "lightgbm/external_libs/fmt/doc", "lightgbm/external_libs/fmt/test"]
1213

src/booster.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ pub struct Booster {
1616
n_classes: i32,
1717
}
1818

19-
// Prediction type
20-
// <https://lightgbm.readthedocs.io/en/latest/C-API.html#c.LGBM_BoosterPredictForMat>
19+
/// Prediction type
20+
///
21+
/// <https://lightgbm.readthedocs.io/en/latest/C-API.html#c.LGBM_BoosterPredictForMat>
2122
enum PredictType {
2223
Normal,
2324
RawScore,
@@ -143,7 +144,7 @@ impl Booster {
143144
self.n_features
144145
}
145146

146-
/// Get the number of iterations.
147+
/// Get the number of iterations in the booster.
147148
pub fn num_iterations(&self) -> i32 {
148149
self.n_iterations
149150
}
@@ -153,7 +154,7 @@ impl Booster {
153154
self.max_iterations
154155
}
155156

156-
/// Sets the the maximum number of iterations for prediction
157+
/// Sets the the maximum number of iterations for prediction.
157158
pub fn set_max_iterations(&mut self, max_iterations: i32) -> Result<()> {
158159
if max_iterations > self.n_iterations {
159160
return Err(Error::new(format!(

src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
//! use lightgbm3::{Dataset, Booster};
3636
//!
3737
//! let bst = Booster::from_file("path/to/model.lgb").unwrap();
38-
//! let features = vec![1.0, 2.0, 33.0, -5.0];
38+
//! let features = vec![1.0, 2.0, -5.0];
3939
//! let n_features = features.len();
4040
//! let y_pred = bst.predict(&features, n_features as i32, true).unwrap()[0];
4141
//! ```
@@ -54,7 +54,7 @@ pub use booster::{Booster, ImportanceType};
5454
pub use dataset::Dataset;
5555
pub use error::{Error, Result};
5656

57-
/// Get the index of the element in a slice with the maximum value
57+
/// Get index of the element in a slice with the maximum value
5858
pub fn argmax<T: PartialOrd>(xs: &[T]) -> usize {
5959
if xs.len() == 1 {
6060
0

0 commit comments

Comments
 (0)