Skip to content

Commit

Permalink
Fix the R package build for windows.
Browse files Browse the repository at this point in the history
  • Loading branch information
jtibshirani committed Apr 14, 2018
1 parent c29cfc2 commit 96f6f73
Show file tree
Hide file tree
Showing 6 changed files with 31 additions and 31 deletions.
6 changes: 3 additions & 3 deletions r-package/grf/bindings/AnalysisToolsBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ Rcpp::NumericMatrix compute_split_frequencies(Rcpp::List forest_object,
Eigen::SparseMatrix<double> compute_sample_weights(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads,
unsigned int num_threads,
bool oob_prediction) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
Expand Down Expand Up @@ -86,15 +86,15 @@ Eigen::SparseMatrix<double> compute_sample_weights(Rcpp::List forest_object,
Eigen::SparseMatrix<double> compute_weights(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads) {
unsigned int num_threads) {
return compute_sample_weights(forest_object, input_data, sparse_input_data, num_threads, false);
}

// [[Rcpp::export]]
Eigen::SparseMatrix<double> compute_weights_oob(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads) {
unsigned int num_threads) {
return compute_sample_weights(forest_object, input_data, sparse_input_data, num_threads, true);
}

Expand Down
18 changes: 9 additions & 9 deletions r-package/grf/bindings/CustomForestBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,18 +29,18 @@
Rcpp::List custom_train(Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
size_t outcome_index,
uint mtry,
uint num_trees,
uint num_threads,
uint min_node_size,
unsigned int mtry,
unsigned int num_trees,
unsigned int num_threads,
unsigned int min_node_size,
double sample_fraction,
uint seed,
unsigned int seed,
bool honesty,
uint ci_group_size,
unsigned int ci_group_size,
double alpha,
double imbalance_penalty,
std::vector<size_t> clusters,
uint samples_per_cluster) {
unsigned int samples_per_cluster) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
ForestOptions options(num_trees, ci_group_size, sample_fraction, mtry, min_node_size,
honesty, alpha, imbalance_penalty, num_threads, seed, clusters, samples_per_cluster);
Expand All @@ -57,7 +57,7 @@ Rcpp::List custom_train(Rcpp::NumericMatrix input_data,
Rcpp::NumericMatrix custom_predict(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads) {
unsigned int num_threads) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
forest_object[RcppUtilities::SERIALIZED_FOREST_KEY]);
Expand All @@ -74,7 +74,7 @@ Rcpp::NumericMatrix custom_predict(Rcpp::List forest_object,
Rcpp::NumericMatrix custom_predict_oob(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads) {
unsigned int num_threads) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
forest_object[RcppUtilities::SERIALIZED_FOREST_KEY]);
Expand Down
2 changes: 1 addition & 1 deletion r-package/grf/bindings/InstrumentalForestBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Rcpp::List instrumental_train(Rcpp::NumericMatrix input_data,
bool imbalance_penalty,
bool stabilize_splits,
std::vector<size_t> clusters,
uint samples_per_cluster) {
unsigned int samples_per_cluster) {
ForestTrainer trainer = ForestTrainers::instrumental_trainer(
outcome_index - 1,
treatment_index - 1,
Expand Down
14 changes: 7 additions & 7 deletions r-package/grf/bindings/QuantileForestBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,18 @@ Rcpp::List quantile_train(std::vector<double> quantiles,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
size_t outcome_index,
uint mtry,
uint num_trees,
unsigned int mtry,
unsigned int num_trees,
int num_threads,
int min_node_size,
double sample_fraction,
uint seed,
unsigned int seed,
bool honesty,
uint ci_group_size,
unsigned int ci_group_size,
double alpha,
double imbalance_penalty,
std::vector<size_t> clusters,
uint samples_per_cluster) {
unsigned int samples_per_cluster) {
ForestTrainer trainer = regression_splits
? ForestTrainers::regression_trainer(outcome_index - 1)
: ForestTrainers::quantile_trainer(outcome_index - 1, quantiles);
Expand All @@ -47,7 +47,7 @@ Rcpp::NumericMatrix quantile_predict(Rcpp::List forest_object,
std::vector<double> quantiles,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads) {
unsigned int num_threads) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
forest_object[RcppUtilities::SERIALIZED_FOREST_KEY]);
Expand All @@ -65,7 +65,7 @@ Rcpp::NumericMatrix quantile_predict_oob(Rcpp::List forest_object,
std::vector<double> quantiles,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads) {
unsigned int num_threads) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
forest_object[RcppUtilities::SERIALIZED_FOREST_KEY]);
Expand Down
22 changes: 11 additions & 11 deletions r-package/grf/bindings/RegressionForestBindings.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,18 @@
Rcpp::List regression_train(Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
size_t outcome_index,
uint mtry,
uint num_trees,
uint num_threads,
uint min_node_size,
unsigned int mtry,
unsigned int num_trees,
unsigned int num_threads,
unsigned int min_node_size,
double sample_fraction,
uint seed,
unsigned int seed,
bool honesty,
uint ci_group_size,
unsigned int ci_group_size,
double alpha,
double imbalance_penalty,
std::vector<size_t> clusters,
uint samples_per_cluster) {
unsigned int samples_per_cluster) {
ForestTrainer trainer = ForestTrainers::regression_trainer(outcome_index - 1);

Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Expand All @@ -44,8 +44,8 @@ Rcpp::List regression_train(Rcpp::NumericMatrix input_data,
Rcpp::List regression_predict(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads,
uint ci_group_size) {
unsigned int num_threads,
unsigned int ci_group_size) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
forest_object[RcppUtilities::SERIALIZED_FOREST_KEY]);
Expand All @@ -62,8 +62,8 @@ Rcpp::List regression_predict(Rcpp::List forest_object,
Rcpp::List regression_predict_oob(Rcpp::List forest_object,
Rcpp::NumericMatrix input_data,
Eigen::SparseMatrix<double> sparse_input_data,
uint num_threads,
uint ci_group_size) {
unsigned int num_threads,
unsigned int ci_group_size) {
Data* data = RcppUtilities::convert_data(input_data, sparse_input_data);
Forest forest = RcppUtilities::deserialize_forest(
forest_object[RcppUtilities::SERIALIZED_FOREST_KEY]);
Expand Down
Binary file modified releases/grf_0.9.6.tar.gz
Binary file not shown.

0 comments on commit 96f6f73

Please sign in to comment.