Skip to content

Commit f513540

Browse files
authored
Update README.md
1 parent 8c83c9d commit f513540

File tree

1 file changed

+0
-43
lines changed

1 file changed

+0
-43
lines changed

README.md

Lines changed: 0 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -45,26 +45,6 @@ h0 <- RcppML::project(A, w = model$w)
4545
RcppML::mse(A, model$w, model$d, model$h)
4646
```
4747

48-
#### C++ class
49-
The `RcppML::MatrixFactorization` class is an object-oriented interface with methods for fitting, projecting, and evaluating linear factor models. It also contains a sparse matrix class equivalent to `Matrix::dgCMatrix` in R.
50-
51-
```{Rcpp}
52-
#include <RcppML.hpp>
53-
54-
//[[Rcpp::export]]
55-
Rcpp::List RunNMF(const Rcpp::S4& A_, int k){
56-
RcppML::Matrix A(A_); // zero-copy, unlike arma or Eigen equivalents
57-
RcppML::MatrixFactorization model(k, A.rows(), A.cols());
58-
model.tol = 1e-5;
59-
model.fit(A);
60-
return Rcpp::List::create(
61-
Rcpp::Named("w") = model.w,
62-
Rcpp::Named("d") = model.d,
63-
Rcpp::Named("h") = model.h,
64-
Rcpp::Named("mse") = model.mse(A));
65-
}
66-
```
67-
6848
## Divisive Clustering
6949
Divisive clustering by rank-2 spectral bipartitioning.
7050
* 2nd SVD vector is linearly related to the difference between factors in rank-2 matrix factorization.
@@ -80,26 +60,3 @@ A <- Matrix::rsparsematrix(A, 1000, 1000, 0.1) # sparse Matrix::dgcMatrix
8060
clusters <- dclust(A, min_dist = 0.001, min_samples = 5)
8161
cluster0 <- bipartition(A)
8262
```
83-
84-
#### C++ class
85-
The `RcppML::clusterModel` class provides an interface to divisive clustering. In the future, more clustering algorithms may be added.
86-
87-
```{Rcpp}
88-
#include <RcppML.hpp>
89-
90-
//[[Rcpp::export]]
91-
Rcpp::List DivisiveCluster(const Rcpp::S4& A_, int min_samples, double min_dist){
92-
RcppML::Matrix A(A_);
93-
RcppML::clusterModel model(A, min_samples, min_dist);
94-
model.dclust();
95-
std::vector<RcppML::cluster> clusters = m.getClusters();
96-
Rcpp::List result(clusters.size());
97-
for (int i = 0; i < clusters.size(); ++i) {
98-
result[i] = Rcpp::List::create(
99-
Rcpp::Named("id") = clusters[i].id,
100-
Rcpp::Named("samples") = clusters[i].samples,
101-
Rcpp::Named("center") = clusters[i].center);
102-
}
103-
return result;
104-
}
105-
```

0 commit comments

Comments
 (0)