# hinge

From maxnet v0.1.2
by Steven Phillips

##### Maxent feature classes

Create and evaluate Maxent's feature classes

- Keywords
- MaxEnt

##### Usage

```
hinge(x, nknots = 50)
thresholds(x, nknots=50)
categorical(x)
```

##### Arguments

- x
- a predictor: a factor for categorical, otherwise numeric.
- nknots
- number of knots.

##### Value

These functions are typically called by `model.matrix`

rather than directly by a user. `hinge`

, `threshold`

and `categorical`

return a matrix with a column for each feature of the specified type. `hinge`

creates `2*nknots-2`

hinge features, half with `min=min(x)`

and half with `max=max(x)`

, and knots evenly spaced between `min(x)`

and `max(x)`

. A hinge feature `h(min,knot)`

or `h(knot,max)`

is 0 if the predictor is below the first argument, 1 if the predictor is above the second argument, and linearly interpolated inbetween. A threshold feature is 1 if the predictor is above the knot, 0 otherwise. A categorical feature is 1 if the predictor matches the category and 0 otherwise.

##### Examples

```
library(maxnet)
data(bradypus)
hinge(bradypus$tmp6190_ann,nknots=10)
categorical(bradypus$ecoreg)
```

*Documentation reproduced from package maxnet, version 0.1.2, License: MIT + file LICENSE*

### Community examples

Looks like there are no examples yet.