# softmax

From mda v0.4-10
by Trevor Hastie

##### Find the Maximum in Each Row of a Matrix

Find the maximum in each row of a matrix.

- Keywords
- utilities

##### Usage

`softmax(x, gap = FALSE)`

##### Arguments

- x
a numeric matrix.

- gap
if

`TRUE`

, the difference between the largest and next largest column is returned.

##### Value

A factor with levels the column labels of `x`

and values the
columns corresponding to the maximum column. If `gap = TRUE`

a
list is returned, the second component of which is the difference
between the largest and next largest column of `x`

.

##### See Also

##### Examples

```
# NOT RUN {
data(iris)
irisfit <- fda(Species ~ ., data = iris)
posteriors <- predict(irisfit, type = "post")
confusion(softmax(posteriors), iris[, "Species"])
# }
```

*Documentation reproduced from package mda, version 0.4-10, License: GPL-2*

### Community examples

Looks like there are no examples yet.