https://github.com/enriquegit/ssr
An R package with Semi-Supervised Regression Methods
https://github.com/enriquegit/ssr
data-science machine-learning r regression semi-supervised-learning
Last synced: 2 days ago
JSON representation
An R package with Semi-Supervised Regression Methods
- Host: GitHub
- URL: https://github.com/enriquegit/ssr
- Owner: enriquegit
- Created: 2019-08-13T13:48:54.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2019-09-05T12:14:20.000Z (almost 7 years ago)
- Last Synced: 2026-04-18T07:11:33.050Z (3 months ago)
- Topics: data-science, machine-learning, r, regression, semi-supervised-learning
- Language: R
- Homepage:
- Size: 185 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# ssr 
[](https://cran.r-project.org/package=ssr)
[](https://travis-ci.org/enriquegit/ssr)
[](https://cran.r-project.org/package=ssr)
An R package for **semi-supervised regression**.
The **ssr** package implements *Co-training by Committee* and *self-learning* semi-supervised learning (SSL) algorithms for **regression**. In semi-supervised learning, algorithms learn model's parameters not only from labeled data but also from unlabeled data. In many applications, it is difficult, expensive, time-consuming, etc. to label data. Thus, semi-supervised methods learn by combining the limited labeled data points and the unlabeled data points.
The **ssr** package provides the following functionalities:
* Train Co-training by Committee models.
* Train self-learning models.
* Track and plot performance during training.
* Generate plots to quickly visualize the results.
* User can specify the base regressors to be used by the Co-training committee and self-learning from the [caret](https://github.com/topepo/caret) package, other packages or custom functions.
## Installation
You can install the **ssr** package from CRAN:
```{r}
install.packages("ssr")
```
or you can install the development version from GitHub.
```{r}
# install.packages("devtools")
devtools::install_github("enriquegit/ssr")
```
## Example
The following example shows how to train a Co-training Committee of two regressors: a linear model and a KNN.
```{r}
library(ssr)
dataset <- friedman1 # Load friedman1 dataset.
set.seed(1234)
# Prepare de data
split1 <- split_train_test(dataset, pctTrain = 70)
split2 <- split_train_test(split1$trainset, pctTrain = 5)
L <- split2$trainset
U <- split2$testset[, -11] # Remove the labels.
testset <- split1$testset
# Define list of regressors.
regressors <- list(linearRegression=lm, knn=caret::knnreg)
# Fit the model.
model <- ssr("Ytrue ~ .", L, U, regressors = regressors, testdata = testset)
# Plot RMSE.
plot(model)
# Get the predictions on the testset.
predictions <- predict(model, testset)
# Calculate RMSE on the test set.
sqrt(mean((predictions - testset$Ytrue)^2))
```
*For detailed explanations and more examples refer to the package* [vignettes](https://CRAN.R-project.org/package=ssr/vignettes/ssr-package-vignette.html).
## Citation
To cite package **ssr** in publications use:
```{r}
Enrique Garcia-Ceja (2019). ssr: Semi-Supervised Regression Methods.
R package https://CRAN.R-project.org/package=ssr
```
BibTex entry for LaTeX:
```{r}
@Manual{enriqueSSR,
title = {ssr: Semi-Supervised Regression Methods},
author = {Enrique Garcia-Ceja},
year = {2019},
note = {R package},
url = {https://CRAN.R-project.org/package=ssr},
}
```