IBCF.MTME Logo

**I**tem **B**ased **C**ollaborative **F**ilterign For **M**ulti-**T**rait and **M**ulti-**E**nvironment Data in R - Development version `r packageVersion('IBCF.MTME')`.

[Last README update: `r format(Sys.Date())`]

Maturing Travis build status Appveyor build status Coverage Status LGPL, Version 3.0 Status of the Repo: Active Dowloads from the CRAN CRAN

Table Of Contents

News of this version (`r packageVersion('IBCF.MTME')`)

See the last updates in NEWS.

Instructions for proper implementation

IBCF.MTME Logo

Installation

To complete installation of dev version of the package IBCF.MTME from GitHub, you must have previously installed the devtools package.

install.packages('devtools')
devtools::install_github('frahik/IBCF.MTME')

If you want to use the stable version of IBCF.MTME package, install it from CRAN.

install.packages('IBCF.MTME')

Load the package

library(IBCF.MTME)

Example of Cross-validation with IBCF.MTME

Load available data from other package

library(BGLR)
data(wheat)

Generate a new data set in tidy data form

pheno <- data.frame(ID = gl(n = 599, k = 1, length = 599*4),
                    Response = as.vector(wheat.Y),
                    Env = paste0('Env', gl(n = 4, k = 599)))

head(pheno)

Generate 10 partitions to do cross-validation

CrossV <- CV.RandomPart(pheno, NPartitions = 10, PTesting = 0.25, Set_seed = 123)

Fitting the predictive model

pm <- IBCF(CrossV)

Show some results

All the predictive model printed output:

pm

Predictions and observed data in tidy format

head(pm$predictions_Summary, 6)

Predictions and observed data in matrix format

head(pm$Data.Obs_Pred, 5)

Some plots

par(mai = c(2, 1, 1, 1))
plot(pm, select = 'Pearson')
plot(pm, select = 'MAAPE')

Example of Years prediction with IBCF.Years Function

library(mvtnorm)
library(IBCF.MTME)
set.seed(2)
A <- matrix(0.65, ncol = 12, nrow = 12)
diag(A) <- 1
Sdv <- diag(c(0.9^0.5,0.8^0.5,0.9^0.5,0.8^0.5,0.86^0.5,0.7^0.5,0.9^0.5,0.8^0.5,0.9^0.5,0.7^0.5,0.7^0.5,0.85^0.5))

Sigma <- Sdv %*% A %*% Sdv
No.Lines <- 80
Z <- rmvnorm(No.Lines,mean = c(15, 15.5, 16, 15.5, 17, 16.5, 16.0, 17, 16.6, 18, 16.3, 18), sigma = Sigma)
Years <- c(rep(2014,20), rep(2015,20), rep(2016,20), rep(2017,20))
Gids <- c(1:No.Lines)

Data.Example <- data.frame(cbind(Years,Gids,Z))
colnames(Data.Example) <- c("Years","Gids","Trait1","Trait2","Trait3","Trait4","Trait5","Trait6","Trait7","Trait8","Trait9","Trait10","Trait11","Trait12")
Data.Example <- getTidyForm(Data.Example, onlyTrait = T)
save(Data.Example, file = 'DataExample.RData')

Loading your data

load('DataExample.RData')
head(Data.Example)

Transforming the data from Tidy data to matrix form

Data.Example <- getMatrixForm(Data.Example, onlyTrait = TRUE)
head(Data.Example)

Adjust the model

pm <- IBCF.Years(Data.Example, colYears = 1, Years.testing = c('2014', '2015', '2016'),
                 Traits.testing = c('Trait1', 'Trait2', 'Trait3', 'Trait4', "Trait5"))

Show some results

summary(pm)

par(mai = c(2, 1, 1, 1))
barplot(pm, las = 2)
barplot(pm, select = 'MAAPE', las = 2)

Load available data from the package

You can use the data sets in the package to test the functions

library(IBCF.MTME)
data('Wheat_IBCF')

head(Wheat_IBCF)
data('Year_IBCF')

head(Year_IBCF)

Citation

First option, by the article paper

@article{IBCF2018,
author = {Montesinos-L{\'{o}}pez, Osval A. and Luna-V{\'{a}}zquez, Francisco Javier and Montesinos-L{\'{o}}pez, Abelardo and Juliana, Philomin and Singh, Ravi and Crossa, Jos{\'{e}}},
doi = {10.3835/plantgenome2018.02.0013},
issn = {1940-3372},
journal = {The Plant Genome},
number = {3},
pages = {16},
title = {{An R Package for Multitrait and Multienvironment Data with the Item-Based Collaborative Filtering Algorithm}},
url = {https://dl.sciencesocieties.org/publications/tpg/abstracts/0/0/180013},
volume = {11},
year = {2018}
}

Second option, by the manual package

citation('IBCF.MTME')

Contributions

If you have any suggestions or feedback, I would love to hear about it. Feel free to report new issues in this link, also if you want to request a feature/report a bug, or make a pull request if you can contribute.

Authors



frahik/IBCF.MTME documentation built on May 22, 2019, 2:39 p.m.