The hardware and bandwidth for this mirror is donated by dogado GmbH, the Webhosting and Full Service-Cloud Provider. Check out our Wordpress Tutorial.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]dogado.de.

Model fitting

For showing model fitting in SSLR, we will use Wine dataset with 20% labeled data:


library(SSLR)
library(tidymodels)
library(caret)
data(wine)

set.seed(1)

#Train and test data
train.index <- createDataPartition(wine$Wine, p = .7, list = FALSE)
train <- wine[ train.index,]
test  <- wine[-train.index,]

cls <- which(colnames(wine) == "Wine")

# 20 % LABELED
labeled.index <- createDataPartition(wine$Wine, p = .2, list = FALSE)
train[-labeled.index,cls] <- NA

In this package we have three functions to fit the different models:

Fit with formula

We can use a formula with data (matrix or data.frame, with unlabeled data NAs in column to predict):

m <- SSLRDecisionTree() %>% fit(Wine ~ ., data = train)

Fit with x and y

We can use x data (matrix or data.frame) and y vector (factor or numeric, with unlabeled data NAs):

m <- SSLRDecisionTree() %>% fit_xy(x = train[,-cls], y = train$Wine)

Fit with x, y and data from unlabeled data

We can use a x (matrix or data.frame) and y vector (factor or numeric, without NAs) and unalabeled data without y column (matrix or data.frame):

m <- SSLRDecisionTree() %>% fit_x_u(x = train[labeled.index,-cls], y = train[labeled.index,cls],
                                     x_U = train[-labeled.index,-cls])

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.
Health stats visible at Monitor.