Skip to content

Commit

Permalink
some clean-up
Browse files Browse the repository at this point in the history
  • Loading branch information
yixuan committed Jul 13, 2016
1 parent ba0f738 commit f19470d
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 9 deletions.
6 changes: 1 addition & 5 deletions R/DataSource.R
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ setClass("DataSource",
#' it is ignored.
#' @param index1 Whether the user indices and item indices start with 1
#' (\code{index1 = TRUE}) or 0 (\code{index1 = FALSE}).
#' @param \dots Currently unused.
#' @return An object of class "DataSource" as required by
#' \code{$\link{tune}()}, \code{$\link{train}()}, and \code{$\link{predict}()}.
#'
Expand Down Expand Up @@ -88,8 +89,3 @@ data_memory = function(user_index, item_index, rating = NULL, index1 = FALSE, ..
new("DataSource", source = list(user_index, item_index, rating),
index1 = index1, type = "memory")
}

data_rmm = function(rmm, ...)
{

}
1 change: 1 addition & 0 deletions R/Output.R
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ setClass("Output",
#' the result is not needed and will not be returned.
#'
#' @param path Path to the output file.
#' @param \dots Currently unused.
#' @return An object of class "Output" as required by
#' \code{$\link{output}()} and \code{$\link{predict}()}.
#'
Expand Down
2 changes: 1 addition & 1 deletion inst/NEWS.Rd
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
has been expanded to and replaced by \code{costp_l1},
\code{costp_l2}, \code{costq_l1}, and \code{costq_l2}, to
allow for more flexibility of the model.
\item Added a \code{loss} parameter in \code{$train()} and
\item A new \code{loss} parameter in \code{$train()} and
\code{$tune()} to specify loss function.
}
\item Other API change:
Expand Down
2 changes: 2 additions & 0 deletions man/data_source.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions man/output_format.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions src/mf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1019,8 +1019,12 @@ mf_model* Utility::init_model(mf_int fun,
}
catch(bad_alloc const &e)
{
cerr << e.what() << endl;
// cerr << e.what() << endl;
// mf_destroy_model(&model);
// throw;

mf_destroy_model(&model);
Rcpp::stop(e.what());
throw;
}

Expand Down Expand Up @@ -3544,8 +3548,12 @@ mf_model* mf_load_model(char const *path)
}
catch(bad_alloc const &e)
{
cerr << e.what() << endl;
// cerr << e.what() << endl;
// mf_destroy_model(&model);
// return nullptr;

mf_destroy_model(&model);
Rcpp::stop(e.what());
return nullptr;
}

Expand Down
2 changes: 1 addition & 1 deletion vignettes/introduction.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -226,7 +226,7 @@ $P$ and $Q$ into files or return them as R objects.

Below is an example on some simulated data:

```{r cache=TRUE}
```{r}
library(recosystem)
set.seed(123) # This is a randomized algorithm
train_set = data_file(system.file("dat", "smalltrain.txt", package = "recosystem"))
Expand Down

0 comments on commit f19470d

Please sign in to comment.