Skip to main content
  • Home
  • Development
  • Documentation
  • Donate
  • Operational login
  • Browse the archive

swh logo
SoftwareHeritage
Software
Heritage
Archive
Features
  • Search

  • Downloads

  • Save code now

  • Add forge now

  • Help

https://github.com/cran/foba
09 July 2024, 18:36:57 UTC
  • Code
  • Branches (28)
  • Releases (0)
  • Visits
    • Branches
    • Releases
    • HEAD
    • refs/heads/master
    • refs/tags/0.1
    • refs/tags/R-2.10.0
    • refs/tags/R-2.10.1
    • refs/tags/R-2.11.0
    • refs/tags/R-2.11.1
    • refs/tags/R-2.12.0
    • refs/tags/R-2.12.1
    • refs/tags/R-2.12.2
    • refs/tags/R-2.13.0
    • refs/tags/R-2.13.1
    • refs/tags/R-2.13.2
    • refs/tags/R-2.14.0
    • refs/tags/R-2.14.1
    • refs/tags/R-2.14.2
    • refs/tags/R-2.15.0
    • refs/tags/R-2.15.1
    • refs/tags/R-2.15.2
    • refs/tags/R-2.15.3
    • refs/tags/R-2.8.0
    • refs/tags/R-2.8.1
    • refs/tags/R-2.9.0
    • refs/tags/R-2.9.1
    • refs/tags/R-2.9.2
    • refs/tags/R-3.0.0
    • refs/tags/R-3.0.1
    • refs/tags/R-3.0.2
    • refs/tags/R-3.0.3
    No releases to show
  • 879bbd9
  • /
  • man
  • /
  • predict.foba.Rd
Raw File Download Save again
Take a new snapshot of a software origin

If the archived software origin currently browsed is not synchronized with its upstream version (for instance when new commits have been issued), you can explicitly request Software Heritage to take a new snapshot of it.

Use the form below to proceed. Once a request has been submitted and accepted, it will be processed as soon as possible. You can then check its processing state by visiting this dedicated page.
swh spinner

Processing "take a new snapshot" request ...

To reference or cite the objects present in the Software Heritage archive, permalinks based on SoftWare Hash IDentifiers (SWHIDs) must be used.
Select below a type of object currently browsed in order to display its associated SWHID and permalink.

  • content
  • directory
  • revision
  • snapshot
origin badgecontent badge
swh:1:cnt:c271fe26011c30514d5daae3d938b58aafcfb682
origin badgedirectory badge
swh:1:dir:64ba1c492557c9278df0e95dc1aba37a100a45c8
origin badgerevision badge
swh:1:rev:ee9dcf0fe7e6add585e0389170265c28adaad73a
origin badgesnapshot badge
swh:1:snp:67253cacceb9adfa84876152d40bbefbd5b60488

This interface enables to generate software citations, provided that the root directory of browsed objects contains a citation.cff or codemeta.json file.
Select below a type of object currently browsed in order to generate citations for them.

  • content
  • directory
  • revision
  • snapshot
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Generate software citation in BibTex format (requires biblatex-software package)
Generating citation ...
Tip revision: ee9dcf0fe7e6add585e0389170265c28adaad73a authored by Tong Zhang on 15 October 2008, 00:00:00 UTC
version0.1
Tip revision: ee9dcf0
predict.foba.Rd
\name{predict.foba}
\alias{predict.foba}
\title{
Make predictions or extract coefficients from a fitted foba model
}
\description{
foba() returns a path of variable addition and deletion.
predict.foba() allows one to extract a prediction, or coefficients at any desired sparsity level.
}
\usage{
predict.foba(object, newx, k, type=c("fit","coefficients"),...)
}
\arguments{
\item{object}{
A fitted foba object.
}
\item{newx}{
If type="fit", then newx should be the x values at which the fit is required.
If type="coefficients", then newx can be omitted.
}
\item{k}{
The sparsity level. That is, the number of selected variables for the fitted model.
}
\item{type}{
If type="fit", predict returns the fitted values. If
type="coefficients", predict returns the coefficients.
Abbreviations allowed.
}
\item{...}{further arguments passed to or from other methods.}
}
\value{
Return either a "coefficients" object or a "fitted value" object,
at the desired sparsity level.

A coefficients object is a list containing the following components:
\item{coefficients}{
coefficients of ridge regression solution using selected.variables
}
\item{intercept}{
the intercept value 
}
\item{selected.variables}{
variables with non-zero coefficients
}

A "fitted value" object contains the following additional component:
\item{fit}{
the predicted response for the data newx
}
}

\details{
FoBa for least squares regression is described in [Tong Zhang (2008)].
This implementation supports ridge regression.
}
\references{
Tong Zhang (2008) "Adaptive Forward-Backward Greedy Algorithm for Learning Sparse Representations", Rutgers Technical Report (long version). 

Tong Zhang (2008) "Adaptive Forward-Backward Greedy Algorithm for Sparse Learning with Linear Models", NIPS'08 (short version).
}

\author{Tong Zhang}
\seealso{
print.foba and foba
}

\examples{
data(boston)

model <- foba(boston$x,boston$y,s=20,nu=0.9)

### make predictions at the values in x, at sparsity level 5

py <- predict(model, boston$x, k=5, type="fit")

print(paste("mean squared error =", mean((py$fit-boston$y)^2)))

### extract the coefficient vector at sparsity level 5
coef <- predict(model, k=5, type="coef")
print("top five variables:")
coef$selected.variables

}
\keyword{regression}
\keyword{methods}

back to top

Software Heritage — Copyright (C) 2015–2026, The Software Heritage developers. License: GNU AGPLv3+.
The source code of Software Heritage itself is available on our development forge.
The source code files archived by Software Heritage are available under their own copyright and licenses.
Terms of use: Archive access, API— Content policy— Contact— JavaScript license information— Web API