Пример 1.

В качестве данных, которые должны быть обучены, представляем выборку из 48 образцов, представляющих собой данные о динамике и структуре процентных ставок в России в период с 1992 – 1995 г. Выборка достаточно репрезентативна, так как за это время Россия прошла все стадии от большой инфляции до относительной стабилизации (за исключением гиперинфляции).

Задача состоит в определении, к какому классу фирма принадлежит в представленный период. В качестве входных параметров возьмем следующие четыре:

  1. - дисконтная процентная ставка
  2. - межбанковская процентная ставка
  3. - ссудная процентная ставка
  4. - депозитная процентная ставка

В качестве выходного образца возьмем подразделение на 3 класса в порядке убывания темпа инфляции:

В качестве нечеткого деления входных параметров на основании опыта эксперта и степени их важности примем такое деление:

состоят из 7 одинаковых нечетких множеств, которые описываются следующими лингвистическими термами – “очень малое”, “малое”, “не малое, но и не среднее”, “среднее”, “не среднее, но и не большое”, “большое”, “очень большое”.

При таком нечетком задании параметров и интервалов их изменения по входному образцу можно составить максимум 27 правил. Так как практически все правила одинаково важны, то целесообразно взять количество скрытых нейронов (нейронов правил) практически равным максимально возможному количеству, отбросив 1-2, выполняющиеся с малой вероятностью. Возьмем 26 скрытых нейронов.

Полная структура входного файла:

% Темп инфляции в России в период 1992 – 1995 г.
% Подразделение на классы в соответствии с темпом инфляции в процентах
% Класс 1 0 0 есть (большая инфляция)
% Класс 0 1 0 есть (средняя инфляция)
% Класс 0 0 1 есть (малая инфляция)
% This file contains a data set with 48 cases

% Name of the pattern set
NAME
ИНФЛЯЦИЯ

% Ranges of the 4 input variables
INRANGES

1 20
2 19.5
2 19.5
1 20
% This are 48 patterns
% first given are the number of patterns, inputs and outputs

PATTERNS
48 4 3

Классификация

1.6

2.6

2.3

1.1

1 0 0

1.6

3.0

3.1

1.4

1 0 0

1.6

3.3

3.8

2.1

1 0 0

4.2

4.0

4.2

3.2

1 0 0

4.2

5.8

5.9

3.7

0 1 0

6.7

6.8

7.4

4.8

0 1 0

6.7

7.7

8.2

4.9

0 1 0

6.7

8.3

8.8

5.6

0 1 0

6.7

8.3

9.0

5.6

0 1 0

6.7

8.6

9.6

6.0

1 0 0

6.7

8.9

9.9

6.3

1 0 0

6.7

9.6

10.1

6.5

1 0 0

6.7

9.9

10.6

6.4

1 0 0


6.7

10.8

11.0

6.8

1 0 0

6.7

11.0

12.1

7.5

1 0 0

8.3

11.3

12.4

8.3

0 1 0

8.3

11.7

12.9

8.6

0 1 0

11.7

12.1

13.3

9.5

0 1 0

14.2

14.5

14.1

10.3

1 0 0

14.2

15.4

15.4

10.8

1 0 0

14.2

15.7

16.2

12.1

1 0 0

17.5

17.3

17.0

12.2

1 0 0

17.5

17.9

17.5

12.3

0 1 0

17.5

17.9

18.1

12.6

0 1 0


17.5

17.9

18.1

13.3

0 1 0

17.5

17.8

18.4

13.5

0 1 0

17.5

17.5

18.7

13.7

0 1 0

17.1

16.7

18.5

13.4

0 1 0

16.7

15.0

17.1

12.1

0 1 0

12.9

12.6

16.1

9.6

0 1 0

12.9

11.3

14.1

9.9

0 1 0

10.8

10.0

13.0

8.3

0 0 1

10.8

10.0

12.0

6.9

0 1 0

14.2

12.4

12.9

7.8

0 1 0

15.0

12.9

13.7

8.7

0 1 0

15.0

13.5

14.5

8.9

0 1 0


16.4

13.6

12.6

8.1

0 1 0

16.7

14.1

13.0

8.7

0 1 0

16.7

13.0

13.0

8.7

0 1 0

16.7

10.9

13.4

8.6

0 1 0

16.5

9.6

13.5

7.9

0 1 0

15.6

6.8

13.0

6.1

0 1 0

15.0

6.8

12.4

5.8

0 1 0

15.0

8.7

11.8

5.5

0 0 1

15.9

6.2

12.1

5.5

0 0 1

14.8

5.1

12.1

5.6

0 0 1

14.2

5.5

12.0

5.4

0 0 1

13.3

5.4

11.8

5.4

0 0 1

END

Полный список параметров нечеткой нейронной сети приведен ниже

Рис.1. а) параметры нейронной сети; б) обучающиеся параметры;
в) нечеткое деление всех множеств

В результате процедуры обучения, состоящего из 200 итераций, были опознаны 46 из 48 образцов. Соответственно показатель сети составляет 95,03% при ошибке, равной 0,83%, что является очень хорошим показателем.

Рис.2. Статистика нечеткой НС после обучения

Рис.3. Разделение на классы в данной ННС

Приведем полный вид выходного файла:

% NEFCLASS 2.04, (c) TU Braunschweig, 1994
% This file was created on 4/27/1996 at 19:27.
%
%Protocol for rule creation and training

%There are 0 proir rules.
%Patterns that have created rules

Pattern 1 created rule 1
Pattern 5 created rule 2
Pattern 6 created rule 3
Pattern 7 created rule 4
Pattern 11 created rule 5
Pattern 13 created rule 6
Pattern 15 created rule 7
Pattern 16 created rule 8
Pattern 18 created rule 9
Pattern 19 created rule 10
Pattern 21 created rule 11
Pattern 22 created rule 12
Pattern 29 created rule 13
Pattern 30 created rule 14
Pattern 31 created rule 15
Pattern 32 created rule 16
Pattern 33 created rule 17
Pattern 34 created rule 18
Pattern 36 created rule 19
Pattern 38 created rule 20
Pattern 39 created rule 21
Pattern 40 created rule 22
Pattern 41 created rule 23
Pattern 42 created rule 24
Pattern 44 created rule 25
Pattern 46 created rule 26
Pattern 48 created rule 27

%An initial rule base with 27 rules was created.
%Rule base file created by NEFCLASS 2.04, (c) TU Braunschweig, 1994
% This file was created on 4/27/1996 at 19:27.
%

IF V_1 is v_small and V_2 is v_small and V_3 is v_small and V_4 is v_small
THEN Class_1

IF V_1 is v_small and V_2 is small and V_3 is small and V_4 is v_small
THEN Class_2

IF V_1 is small and V_2 is small and V_3 is small and V_4 is small
THEN Class_2

IF V_1 is small and V_2 is l_small and V_3 is l_small and V_4 is small
THEN Class_2

IF V_1 is small and V_2 is l_small and V_3 is medium and V_4 is small
THEN Class_1

IF V_1 is small and V_2 is medium and V_3 is medium and V_4 is small
THEN Class_1

IF V_1 is small and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_1

IF V_1 is l_small and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is l_large and V_2 is l_large and V_3 is l_large and V_4 is medium
THEN Class_2

IF V_1 is large and V_2 is large and V_3 is large and V_4 is medium
THEN Class_1

IF V_1 is large and V_2 is large and V_3 is large and V_4 is l_lagre
THEN Class_1

IF V_1 is v_large and V_2 is v_large and V_3 is v_large and V_4 is l_large
THEN Class_2

IF V_1 is v_large and V_2 is large and V_3 is v_large and V_4 is l_large
THEN Class_2

IF V_1 is l_large and V_2 is l_large and V_3 is large and V_4 is medium
THEN Class_2

IF V_1 is l_large and V_2 is medium and V_3 is large and V_4 is medium
THEN Class_2

IF V_1 is medium and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_3

IF V_1 is medium and V_2 is medium and V_3 is l_large and V_4 is small
THEN Class_2

IF V_1 is large and V_2 is l_large and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is large and V_2 is l_large and V_3 is large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is large and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is l_large and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is l_small and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is large and V_2 is small and V_3 is l_large and V_4 is small
THEN Class_2

IF V_1 is large and V_2 is l_small and V_3 is medium and V_4 is small
THEN Class_3

IF V_1 is large and V_2 is v_small and V_3 is l_large and V_4 is small
THEN Class_3

IF V_1 is l_large and V_2 is small and V_3 is medium and V_4 is small
THEN Class_3

%Accumulated rule activations per class

1) 3.6526 0.2171 0.0000
2) 0.0000 0.6526 0.0000
3) 0.0000 0.8340 0.0000
4) 1.2800 1.9943 0.0000
5) 1.9886 0.3086 0.0000
6) 2.0668 0.0000 0.0000
7) 0.7143 0.0000 0.0000
8) 0.5143 1.3143 0.0000
9) 0.2857 0.9672 0.0000
10) 1.4156 0.4171 0.0000
11) 0.6349 0.1029 0.0000
12) 0.0000 5.2884 0.0000
13) 0.0000 0.8962 0.0000
14) 0.2857 1.1820 0.0000
15) 0.0000 0.8686 0.0286
16) 0.0000 1.0144 0.6571
17) 0.0000 0.5158 0.0000
18) 0.0842 2.8689 0.0000
19) 0.0842 1.1690 0.0000
20) 0.0000 0.8629 0.0000
21) 0.0000 1.6319 0.0000
22) 0.0000 1.0848 0.0000
23) 0.0000 0.6731 0.0000
24) 0.0000 1.5600 1.7711
25) 0.0000 0.1943 0.5200
26) 0.0000 0.0000 1.2418
27) 0.0000 0.1053 1.2433

% Change of rule conclusions

Conclusion of Rule 16 was changed from 3 to 2.
Conclusion of Rule 24 was changed from 2 to 3.

%Overall rule performance

1) 3.4355
2) 0.6526
3) 0.8340
4) 0.7143
5) 1.6800
6) 2.0668
7) 0.7143
8) 0.8000
9) 0.6815
10) 0.9985
11) 0.5320
12) 5.2884
13) 0.8962
14) 0.8962
15) 0.8400
16) 0.3573
17) 0.5158
18) 2.7847
19) 1.0848
20) 0.8629
21) 1.6319
22) 1.0848
23) 0.3783
24) 0.2111
25) 0.3257
26) 1.2418
27) 1.1380

% The 26 best rules have been selected.
% Rule base file created by NEFCLASS 2.04, (c) TU Braunschweig, 1994
% This file was created on 4/27/1996 at 19:27.
%

IF V_1 is v_small and V_2 is v_small and V_3 is v_small and V_4 is v_small
THEN Class_1

IF V_1 is v_small and V_2 is small and V_3 is small and V_4 is v_small
THEN Class_2

IF V_1 is small and V_2 is small and V_3 is small and V_4 is small
THEN Class_2

IF V_1 is small and V_2 is l_small and V_3 is l_small and V_4 is small
THEN Class_2

IF V_1 is small and V_2 is l_small and V_3 is medium and V_4 is small
THEN Class_1

IF V_1 is small and V_2 is medium and V_3 is medium and V_4 is small
THEN Class_1

IF V_1 is small and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_1

IF V_1 is l_small and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is l_large and V_2 is l_large and V_3 is l_large and V_4 is medium
THEN Class_2

IF V_1 is large and V_2 is large and V_3 is large and V_4 is medium
THEN Class_1

IF V_1 is large and V_2 is large and V_3 is large and V_4 is l_large
THEN Class_1

IF V_1 is v_large and V_2 is v_large and V_3 is v_large and V_4 is l_large
THEN Class_2

IF V_1 is v_large and V_2 is large and V_3 is v_large and V_4 is l_large
THEN Class_2

IF V_1 is l_large and V_2 is l_large and V_3 is large and V_4 is medium
THEN Class_2

IF V_1 is l_large and V_2 is medium and V_3 is large and V_4 is medium
THEN Class_2

IF V_1 is medium and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is medium and V_2 is medium and V_3 is l_large and V_4 is small
THEN Class_2

IF V_1 is large and V_2 is l_large and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is large and V_2 is l_large and V_3 is large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is large and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is l_large and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is medium and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is v_large and V_2 is l_small and V_3 is l_large and V_4 is l_small
THEN Class_2

IF V_1 is large and V_2 is l_small and V_3 is medium and V_4 is small
THEN Class_3

IF V_1 is large and V_2 is v_small and V_3 is l_large and V_4 is small
THEN Class_3

IF V_1 is l_large and V_2 is small and V_3 is medium and V_4 is small
THEN Class_3

%Protocol of global error and number of misclassifications

1 40.278674 2
10 40.274634 2
20 40.270142 2
30 40.265646 2
40 40.261145 2
50 40.256641 2
60 40.252133 2
70 40.247622 2
80 40.243106 2
90 40.238587 2
100 40.234064 2
110 40.229537 2
120 40.225007 2
130 40.220473 2
140 40.215935 2
150 40.211282 2
160 40.206596 2
170 40.201905 2
180 40.197209 2
190 40.192553 2
200 40.187930 2

Теперь произведем обучение следующих 5 новых образцов по уже полученной базе правил:

6.7 11.0 12.1 7.5
8.3 11.3 12.4 8.3
14.2 5.5 12.0 5.4
17.2 17.4 18.3 13.0
15.8 12.9 12.9 8.1

Представим полную структуру входного файла:

%Темп инфляции в России в период с 1992 по 1995г
%Подразделение на классы в соответствии с темпом инфляции в процентах
% Класс 1 0 0 есть (большая инфляция)
% Класс 0 1 0 есть (средняя инфляция)
% Класс 0 0 1 есть (малая инфляция)
%This file contains a data set with 48 cases

%Name of the pattern set
NAME
ИНФЛЯЦИЯ

UNKNOWN

%Ranges of the 4 input variables
INRANGES

1 20
2 19.5
2 19.5
1 20
%This are 48 patterns,
%first given are number of patterns, inputs and outputs

PATTERNS
5 4 0

6.7 11.0 12.1 7.5
8.3 11.3 12.4 8.3
14.2 5.5 12.0 5.4
17.2 17.4 18.3 13.0
15.8 12.9 12.9 8.1

END

В результате получаем, что 1 образец наиболее вероятно принадлежит первому классу; 2, 4 и 5 – наиболее вероятно принадлежат второму классу; 3 – наиболее вероятно принадлежит третьему классу. Это наглядно видно из тестирования сети после обучения:

Рис.32. Результат кластеризации а) 1 образца; б) 2 образца;
в) 3 образца; г) 4 образца; д) 5образца.

Результат проделанного эксперимента хорошо демонстрирует эффективность системы NEFCLASS.