Skip to content

Commit 26635aa

Browse files
committed
rename classificator to classifier
1 parent 80f3416 commit 26635aa

3 files changed

Lines changed: 33 additions & 33 deletions

File tree

README.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ Returns the coefficient of determination R^2 of the prediction:
6060

6161
### K-Nearest Neighbours classification
6262

63-
Initialize classificator with data set consists from labels and features:
63+
Initialize classifier with data set consists from labels and features:
6464

6565
```elixir
6666
alias LearnKit.Knn
67-
classificator = Knn.new
67+
classifier = Knn.new
6868
|> Knn.add_train_data({:a1, [-1, -1]})
6969
|> Knn.add_train_data({:a1, [-2, -1]})
7070
|> Knn.add_train_data({:a2, [1, 1]})
@@ -73,7 +73,7 @@ Initialize classificator with data set consists from labels and features:
7373
Predict label for new feature:
7474

7575
```elixir
76-
Knn.classify(classificator, [feature: [-1, -2], k: 3, weight: "distance"])
76+
Knn.classify(classifier, [feature: [-1, -2], k: 3, weight: "distance"])
7777
```
7878
feature - new feature for prediction, required
7979
k - number of nearest neighbors, optional, default - 3
@@ -82,11 +82,11 @@ Predict label for new feature:
8282

8383
### Gaussian Naive Bayes classification
8484

85-
Initialize classificator with data set consists from labels and features:
85+
Initialize classifier with data set consists from labels and features:
8686

8787
```elixir
8888
alias LearnKit.NaiveBayes.Gaussian
89-
classificator = Gaussian.new
89+
classifier = Gaussian.new
9090
|> Gaussian.add_train_data({:a1, [-1, -1]})
9191
|> Gaussian.add_train_data({:a1, [-2, -1]})
9292
|> Gaussian.add_train_data({:a2, [1, 1]})
@@ -95,27 +95,27 @@ Initialize classificator with data set consists from labels and features:
9595
Fit data set:
9696

9797
```elixir
98-
classificator = classificator |> Gaussian.fit
98+
classifier = classifier |> Gaussian.fit
9999
```
100100

101101
Return probability estimates for the feature:
102102

103103
```elixir
104-
classificator |> Gaussian.predict_proba([1, 2])
104+
classifier |> Gaussian.predict_proba([1, 2])
105105
```
106106
feature - new feature for prediction, required
107107

108108
Return exact prediction for the feature:
109109

110110
```elixir
111-
classificator |> Gaussian.predict([1, 2])
111+
classifier |> Gaussian.predict([1, 2])
112112
```
113113
feature - new feature for prediction, required
114114

115115
Returns the mean accuracy on the given test data and labels:
116116

117117
```elixir
118-
classificator |> Gaussian.score
118+
classifier |> Gaussian.score
119119
```
120120

121121
## Contributing

lib/learn_kit/knn.ex

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@ defmodule LearnKit.Knn do
1616
@type data_set :: [{label, features}]
1717

1818
@doc """
19-
Creates classificator with empty data_set
19+
Creates classifier with empty data_set
2020
2121
## Examples
2222
23-
iex> classificator = LearnKit.Knn.new
23+
iex> classifier = LearnKit.Knn.new
2424
%LearnKit.Knn{data_set: []}
2525
2626
"""
@@ -32,15 +32,15 @@ defmodule LearnKit.Knn do
3232
end
3333

3434
@doc """
35-
Creates classificator with data_set
35+
Creates classifier with data_set
3636
3737
## Parameters
3838
3939
- data_set: Keyword list with labels and features in tuples
4040
4141
## Examples
4242
43-
iex> classificator = LearnKit.Knn.new([{:a1, [[1, 2], [2, 3]]}, {:b1, [[-1, -2]]}])
43+
iex> classifier = LearnKit.Knn.new([{:a1, [[1, 2], [2, 3]]}, {:b1, [[-1, -2]]}])
4444
%LearnKit.Knn{data_set: [a1: [[1, 2], [2, 3]], b1: [[-1, -2]]]}
4545
4646
"""
@@ -51,16 +51,16 @@ defmodule LearnKit.Knn do
5151
end
5252

5353
@doc """
54-
Add train data to classificator
54+
Add train data to classifier
5555
5656
## Parameters
5757
58-
- classificator: %LearnKit.Knn{}
58+
- classifier: %LearnKit.Knn{}
5959
- train data: tuple with label and feature
6060
6161
## Examples
6262
63-
iex> classificator = classificator |> LearnKit.Knn.add_train_data({:a1, [-1, -1]})
63+
iex> classifier = classifier |> LearnKit.Knn.add_train_data({:a1, [-1, -1]})
6464
%LearnKit.Knn{data_set: [a1: [[-1, -1]]]}
6565
6666
"""
@@ -77,7 +77,7 @@ defmodule LearnKit.Knn do
7777
7878
## Parameters
7979
80-
- classificator: %LearnKit.Knn{}
80+
- classifier: %LearnKit.Knn{}
8181
- options: keyword list with options
8282
8383
## Options
@@ -89,7 +89,7 @@ defmodule LearnKit.Knn do
8989
9090
## Examples
9191
92-
iex> classificator |> LearnKit.Knn.classify([feature: [-1, -2], k: 3, weight: "distance"])
92+
iex> classifier |> LearnKit.Knn.classify([feature: [-1, -2], k: 3, weight: "distance"])
9393
{:ok, :a1}
9494
9595
"""

lib/learn_kit/naive_bayes/gaussian.ex

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@ defmodule LearnKit.NaiveBayes.Gaussian do
2323
@type fit_data :: [{label, fit_features}]
2424

2525
@doc """
26-
Creates classificator with empty data_set
26+
Creates classifier with empty data_set
2727
2828
## Examples
2929
30-
iex> classificator = LearnKit.NaiveBayes.Gaussian.new
30+
iex> classifier = LearnKit.NaiveBayes.Gaussian.new
3131
%LearnKit.NaiveBayes.Gaussian{data_set: [], fit_data: []}
3232
3333
"""
@@ -39,15 +39,15 @@ defmodule LearnKit.NaiveBayes.Gaussian do
3939
end
4040

4141
@doc """
42-
Creates classificator with data_set
42+
Creates classifier with data_set
4343
4444
## Parameters
4545
4646
- data_set: Keyword list with labels and features in tuples
4747
4848
## Examples
4949
50-
iex> classificator = LearnKit.NaiveBayes.Gaussian.new([{:a1, [[1, 2], [2, 3]]}, {:b1, [[-1, -2]]}])
50+
iex> classifier = LearnKit.NaiveBayes.Gaussian.new([{:a1, [[1, 2], [2, 3]]}, {:b1, [[-1, -2]]}])
5151
%LearnKit.NaiveBayes.Gaussian{data_set: [a1: [[1, 2], [2, 3]], b1: [[-1, -2]]], fit_data: []}
5252
5353
"""
@@ -58,16 +58,16 @@ defmodule LearnKit.NaiveBayes.Gaussian do
5858
end
5959

6060
@doc """
61-
Add train data to classificator
61+
Add train data to classifier
6262
6363
## Parameters
6464
65-
- classificator: %LearnKit.NaiveBayes.Gaussian{}
65+
- classifier: %LearnKit.NaiveBayes.Gaussian{}
6666
- train data: tuple with label and feature
6767
6868
## Examples
6969
70-
iex> classificator = classificator |> LearnKit.NaiveBayes.Gaussian.add_train_data({:a1, [-1, -1]})
70+
iex> classifier = classifier |> LearnKit.NaiveBayes.Gaussian.add_train_data({:a1, [-1, -1]})
7171
%LearnKit.NaiveBayes.Gaussian{data_set: [a1: [[-1, -1]]], fit_data: []}
7272
7373
"""
@@ -84,11 +84,11 @@ defmodule LearnKit.NaiveBayes.Gaussian do
8484
8585
## Parameters
8686
87-
- classificator: %LearnKit.NaiveBayes.Gaussian{}
87+
- classifier: %LearnKit.NaiveBayes.Gaussian{}
8888
8989
## Examples
9090
91-
iex> classificator = classificator |> LearnKit.NaiveBayes.Gaussian.fit
91+
iex> classifier = classifier |> LearnKit.NaiveBayes.Gaussian.fit
9292
%LearnKit.NaiveBayes.Gaussian{
9393
data_set: [a1: [[-1, -1]]],
9494
fit_data: [
@@ -111,11 +111,11 @@ defmodule LearnKit.NaiveBayes.Gaussian do
111111
112112
## Parameters
113113
114-
- classificator: %LearnKit.NaiveBayes.Gaussian{}
114+
- classifier: %LearnKit.NaiveBayes.Gaussian{}
115115
116116
## Examples
117117
118-
iex> classificator |> LearnKit.NaiveBayes.Gaussian.predict_proba([1, 2])
118+
iex> classifier |> LearnKit.NaiveBayes.Gaussian.predict_proba([1, 2])
119119
{:ok, [a1: 0.0359, a2: 0.0039]}
120120
121121
"""
@@ -131,11 +131,11 @@ defmodule LearnKit.NaiveBayes.Gaussian do
131131
132132
## Parameters
133133
134-
- classificator: %LearnKit.NaiveBayes.Gaussian{}
134+
- classifier: %LearnKit.NaiveBayes.Gaussian{}
135135
136136
## Examples
137137
138-
iex> classificator |> LearnKit.NaiveBayes.Gaussian.predict([1, 2])
138+
iex> classifier |> LearnKit.NaiveBayes.Gaussian.predict([1, 2])
139139
{:ok, {:a1, 0.334545454}}
140140
141141
"""
@@ -151,11 +151,11 @@ defmodule LearnKit.NaiveBayes.Gaussian do
151151
152152
## Parameters
153153
154-
- classificator: %LearnKit.NaiveBayes.Gaussian{}
154+
- classifier: %LearnKit.NaiveBayes.Gaussian{}
155155
156156
## Examples
157157
158-
iex> classificator |> LearnKit.NaiveBayes.Gaussian.score
158+
iex> classifier |> LearnKit.NaiveBayes.Gaussian.score
159159
{:ok, 0.857143}
160160
161161
"""

0 commit comments

Comments
 (0)