Liking cljdoc? Tell your friends :D
Clojure only.

clj-synapses.stats

Measure the difference between the values predicted by a neural network and the observed values.

(require '[clj-synapses.stats :as stats])

Calculate the root mean square error:

(stats/rmse
  [[[0.0, 0.0, 1.0] [0.0, 0.0, 1.0]]
   [[0.0, 0.0, 1.0] [0.0, 1.0, 1.0]]])
;;=> 0.7071067811865476

Calculate the score of the classification accuracy:

(stats/score
  [[[0.0, 0.0, 1.0], [0.0, 0.1, 0.9]]
   [[0.0, 1.0, 0.0], [0.8, 0.2, 0.0]]
   [[1.0, 0.0, 0.0], [0.7, 0.1, 0.2]]
   [[1.0, 0.0, 0.0], [0.3, 0.3, 0.4]]
   [[0.0, 0.0, 1.0], [0.2, 0.2, 0.6]]])
;;=> 0.6
Measure the difference between the values predicted by a neural network and the observed values.

```clojure
(require '[clj-synapses.stats :as stats])
```

Calculate the root mean square error:

```clojure
(stats/rmse
  [[[0.0, 0.0, 1.0] [0.0, 0.0, 1.0]]
   [[0.0, 0.0, 1.0] [0.0, 1.0, 1.0]]])
;;=> 0.7071067811865476
```

Calculate the score of the classification accuracy:

```clojure
(stats/score
  [[[0.0, 0.0, 1.0], [0.0, 0.1, 0.9]]
   [[0.0, 1.0, 0.0], [0.8, 0.2, 0.0]]
   [[1.0, 0.0, 0.0], [0.7, 0.1, 0.2]]
   [[1.0, 0.0, 0.0], [0.3, 0.3, 0.4]]
   [[0.0, 0.0, 1.0], [0.2, 0.2, 0.6]]])
;;=> 0.6
```
raw docstring

rmseclj

(rmse exp-and-pred-vals)

Returns the the standard deviation of the prediction errors (root-mean-square-error). exp-and-pred-vals is a collection of pairs that contain the expected and predicted values.

(stats/rmse
  [[[0.0, 0.0, 1.0] [0.0, 0.0, 1.0]]
   [[0.0, 0.0, 1.0] [0.0, 1.0, 1.0]]])
;;=> 0.7071067811865476
Returns the the standard deviation of the prediction errors (root-mean-square-error).
`exp-and-pred-vals` is a collection of pairs that contain the expected and predicted values.

```clojure
(stats/rmse
  [[[0.0, 0.0, 1.0] [0.0, 0.0, 1.0]]
   [[0.0, 0.0, 1.0] [0.0, 1.0, 1.0]]])
;;=> 0.7071067811865476
```
sourceraw docstring

scoreclj

(score exp-and-pred-vals)

Returns the ratio of number of correct predictions to the total number of provided pairs. For a prediction to be considered as correct, the index of its maximum expected value needs to be the same with the index of its maximum predicted value. exp-and-pred-vals is a collection of pairs that contain the expected and predicted values.

(stats/score
  [[[0.0, 0.0, 1.0], [0.0, 0.1, 0.9]]
   [[0.0, 1.0, 0.0], [0.8, 0.2, 0.0]]
   [[1.0, 0.0, 0.0], [0.7, 0.1, 0.2]]
   [[1.0, 0.0, 0.0], [0.3, 0.3, 0.4]]
   [[0.0, 0.0, 1.0], [0.2, 0.2, 0.6]]])
;;=> 0.6
Returns the ratio of number of correct predictions to the total number of provided pairs.
For a prediction to be considered as correct, the index of its maximum expected value
needs to be the same with the index of its maximum predicted value.
`exp-and-pred-vals` is a collection of pairs that contain the expected and predicted values.

```clojure
(stats/score
  [[[0.0, 0.0, 1.0], [0.0, 0.1, 0.9]]
   [[0.0, 1.0, 0.0], [0.8, 0.2, 0.0]]
   [[1.0, 0.0, 0.0], [0.7, 0.1, 0.2]]
   [[1.0, 0.0, 0.0], [0.3, 0.3, 0.4]]
   [[0.0, 0.0, 1.0], [0.2, 0.2, 0.6]]])
;;=> 0.6
```
sourceraw docstring

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close