Skip to content

Commit 08587e8

Browse files
committed
Create .Rmd README
1 parent d7594f3 commit 08587e8

File tree

5 files changed

+362
-24
lines changed

5 files changed

+362
-24
lines changed

.Rbuildignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,4 +13,6 @@ derby.log
1313
^revdep$
1414
^README\.md$
1515
^issue_template.md$
16-
^\.github/workflows/R-CMD-check\.yaml$
16+
^README\.Rmd$
17+
^\.github$
18+
^CODE_OF_CONDUCT\.md$

CODE_OF_CONDUCT.md

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity and
10+
orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment for our
18+
community include:
19+
20+
* Demonstrating empathy and kindness toward other people
21+
* Being respectful of differing opinions, viewpoints, and experiences
22+
* Giving and gracefully accepting constructive feedback
23+
* Accepting responsibility and apologizing to those affected by our mistakes,
24+
and learning from the experience
25+
* Focusing on what is best not just for us as individuals, but for the overall
26+
community
27+
28+
Examples of unacceptable behavior include:
29+
30+
* The use of sexualized language or imagery, and sexual attention or
31+
advances of any kind
32+
* Trolling, insulting or derogatory comments, and personal or political attacks
33+
* Public or private harassment
34+
* Publishing others' private information, such as a physical or email
35+
address, without their explicit permission
36+
* Other conduct which could reasonably be considered inappropriate in a
37+
professional setting
38+
39+
## Enforcement Responsibilities
40+
41+
Community leaders are responsible for clarifying and enforcing our standards
42+
of acceptable behavior and will take appropriate and fair corrective action in
43+
response to any behavior that they deem inappropriate, threatening, offensive,
44+
or harmful.
45+
46+
Community leaders have the right and responsibility to remove, edit, or reject
47+
comments, commits, code, wiki edits, issues, and other contributions that are
48+
not aligned to this Code of Conduct, and will communicate reasons for moderation
49+
decisions when appropriate.
50+
51+
## Scope
52+
53+
This Code of Conduct applies within all community spaces, and also applies
54+
when an individual is officially representing the community in public spaces.
55+
Examples of representing our community include using an official e-mail
56+
address, posting via an official social media account, or acting as an appointed
57+
representative at an online or offline event.
58+
59+
## Enforcement
60+
61+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62+
reported to the community leaders responsible for enforcement at [INSERT CONTACT
63+
METHOD]. All complaints will be reviewed and investigated promptly and fairly.
64+
65+
All community leaders are obligated to respect the privacy and security of the
66+
reporter of any incident.
67+
68+
## Enforcement Guidelines
69+
70+
Community leaders will follow these Community Impact Guidelines in determining
71+
the consequences for any action they deem in violation of this Code of Conduct:
72+
73+
### 1. Correction
74+
75+
**Community Impact**: Use of inappropriate language or other behavior deemed
76+
unprofessional or unwelcome in the community.
77+
78+
**Consequence**: A private, written warning from community leaders, providing
79+
clarity around the nature of the violation and an explanation of why the
80+
behavior was inappropriate. A public apology may be requested.
81+
82+
### 2. Warning
83+
84+
**Community Impact**: A violation through a single incident or series of
85+
actions.
86+
87+
**Consequence**: A warning with consequences for continued behavior. No
88+
interaction with the people involved, including unsolicited interaction with
89+
those enforcing the Code of Conduct, for a specified period of time. This
90+
includes avoiding interactions in community spaces as well as external channels
91+
like social media. Violating these terms may lead to a temporary or permanent
92+
ban.
93+
94+
### 3. Temporary Ban
95+
96+
**Community Impact**: A serious violation of community standards, including
97+
sustained inappropriate behavior.
98+
99+
**Consequence**: A temporary ban from any sort of interaction or public
100+
communication with the community for a specified period of time. No public or
101+
private interaction with the people involved, including unsolicited interaction
102+
with those enforcing the Code of Conduct, is allowed during this period.
103+
Violating these terms may lead to a permanent ban.
104+
105+
### 4. Permanent Ban
106+
107+
**Community Impact**: Demonstrating a pattern of violation of community
108+
standards, including sustained inappropriate behavior, harassment of an
109+
individual, or aggression toward or disparagement of classes of individuals.
110+
111+
**Consequence**: A permanent ban from any sort of public interaction within the
112+
community.
113+
114+
## Attribution
115+
116+
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
117+
version 2.0,
118+
available at https://www.contributor-covenant.org/version/2/0/
119+
code_of_conduct.html.
120+
121+
Community Impact Guidelines were inspired by [Mozilla's code of conduct
122+
enforcement ladder](https://github.com/mozilla/diversity).
123+
124+
[homepage]: https://www.contributor-covenant.org
125+
126+
For answers to common questions about this code of conduct, see the FAQ at
127+
https://www.contributor-covenant.org/faq. Translations are available at https://
128+
www.contributor-covenant.org/translations.

README.Rmd

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2+
<!-- README.md is generated from README.Rmd. Please edit that file -->
3+
4+
```{r, include = FALSE}
5+
knitr::opts_chunk$set(
6+
collapse = TRUE,
7+
comment = "#>",
8+
fig.path = "man/figures/README-",
9+
out.width = "100%"
10+
)
11+
```
12+
13+
# parsnip <a href='https://tidymodels.github.io/parsnip/'><img src='man/figures/logo.png' align="right" height="139" /></a>
14+
15+
<!-- badges: start -->
16+
[![Build Status](https://travis-ci.org/tidymodels/parsnip.svg?branch=master)](https://travis-ci.org/tidymodels/parsnip)
17+
[![R build status](https://github.com/tidymodels/parsnip/workflows/R-CMD-check/badge.svg)](https://github.com/tidymodels/parsnip)
18+
[![Coverage status](https://codecov.io/gh/tidymodels/parsnip/branch/master/graph/badge.svg)](https://codecov.io/github/tidymodels/parsnip?branch=master)
19+
[![CRAN\_Status\_Badge](http://www.r-pkg.org/badges/version/parsnip)](https://cran.rstudio.com/package=parsnip)
20+
[![Downloads](http://cranlogs.r-pkg.org/badges/parsnip)](https://cran.rstudio.com/package=parsnip)
21+
[![lifecycle](https://img.shields.io/badge/lifecycle-maturing-blue.svg)](https://www.tidyverse.org/lifecycle/#maturing)
22+
<!-- badges: end -->
23+
24+
## Introduction
25+
26+
The goal of parsnip is to provide a tidy, unified interface to models that can be used to try a range of models without getting bogged down in the syntactical minutiae of the underlying packages.
27+
28+
## Installation
29+
30+
```{r, eval = FALSE}
31+
# The easiest way to get parsnip is to install all of tidymodels:
32+
install.packages("tidymodels")
33+
34+
# Alternatively, install just parsnip:
35+
install.packages("parsnip")
36+
37+
# Or the development version from GitHub:
38+
# install.packages("devtools")
39+
devtools::install_github("tidymodels/parsnip")
40+
```
41+
42+
43+
## Getting started
44+
45+
One challenge with different modeling functions available in R _that do the same thing_ is that they can have different interfaces and arguments. For example, to fit a random forest _regression_ model, we might have:
46+
47+
```{r eval=FALSE}
48+
# From randomForest
49+
rf_1 <- randomForest(
50+
y ~ .,
51+
data = .,
52+
mtry = 10,
53+
ntree = 2000,
54+
importance = TRUE
55+
)
56+
57+
# From ranger
58+
rf_2 <- ranger(
59+
y ~ .,
60+
data = dat,
61+
mtry = 10,
62+
num.trees = 2000,
63+
importance = "impurity"
64+
)
65+
66+
# From sparklyr
67+
rf_3 <- ml_random_forest(
68+
dat,
69+
intercept = FALSE,
70+
response = "y",
71+
features = names(dat)[names(dat) != "y"],
72+
col.sample.rate = 10,
73+
num.trees = 2000
74+
)
75+
```
76+
77+
Note that the model syntax can be very different and that the argument names (and formats) are also different. This is a pain if you switch between implementations.
78+
79+
In this example:
80+
81+
* the **type** of model is "random forest",
82+
* the **mode** of the model is "regression" (as opposed to classification, etc), and
83+
* the computational **engine** is the name of the R package.
84+
85+
86+
The goals of parsnip are to:
87+
88+
* Separate the definition of a model from its evaluation.
89+
* Decouple the model specification from the implementation (whether the implementation is in R, spark, or something else). For example, the user would call `rand_forest` instead of `ranger::ranger` or other specific packages.
90+
* Harmonize argument names (e.g. `n.trees`, `ntrees`, `trees`) so that users only need to remember a single name. This will help _across_ model types too so that `trees` will be the same argument across random forest as well as boosting or bagging.
91+
92+
Using the example above, the `parsnip` approach would be:
93+
94+
```{r}
95+
library(parsnip)
96+
97+
rand_forest(mtry = 10, trees = 2000) %>%
98+
set_engine("ranger", importance = "impurity") %>%
99+
set_mode("regression")
100+
```
101+
102+
The engine can be easily changed. To use Spark, the change is straightforward:
103+
104+
```{r}
105+
rand_forest(mtry = 10, trees = 2000) %>%
106+
set_engine("spark") %>%
107+
set_mode("regression")
108+
```
109+
110+
Either one of these model specifications can be fit in the same way:
111+
112+
```{r}
113+
rand_forest(mtry = 10, trees = 2000) %>%
114+
set_engine("ranger", importance = "impurity") %>%
115+
set_mode("regression") %>%
116+
fit(mpg ~ ., data = mtcars)
117+
```
118+
119+
120+
121+
## Contributing
122+
123+
If you encounter a bug, please file a minimal reproducible example on [GitHub](https://github.com/tidymodels/parsnip/issues). For questions and other discussion, please use [community.rstudio.com](https://community.rstudio.com/).
124+
125+
Please note that the parsnip project is released with a [Contributor Code of Conduct](https://contributor-covenant.org/version/2/0/CODE_OF_CONDUCT.html). By contributing to this project, you agree to abide by its terms.

0 commit comments

Comments
 (0)