You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+69-40Lines changed: 69 additions & 40 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -33,16 +33,17 @@ FuzzyClassificator
33
33
34
34
35
35
<aname="Chapter_1"></a>Introduction
36
-
--------------
36
+
------------------------------------
37
37
38
38
This program uses neural networks to solve classification problems, and uses fuzzy sets and fuzzy logic to interpreting results. FuzzyClassificator provided under the MIT License.
39
39
40
40
How does it work? Let see process scheme below.
41
41
42
42

43
43
44
+
44
45
<aname="Chapter_2"></a>How to use
45
-
--------------
46
+
----------------------------------
46
47
47
48
FuzzyClassificator uses ethalons.dat (default) as learning data and candidates.dat (default) for classifying data (See "Preparing data" chapter).
48
49
Work contains two steps:
@@ -121,13 +122,18 @@ In all examples below, we used an Anaconda Python interpreter when you saw keywo
121
122
--no-fuzzy
122
123
Add key if You doesn't want show fuzzy results, only real. Not set by default.
123
124
125
+
--show-expected
126
+
Show expected results in Classify mode.
127
+
WARNING! Use only if your dat-file contains columns with expected results!
128
+
124
129
--reload
125
130
Add key if You want reload network from file before usage. Not set by default.
126
131
127
132
-u [epochs], --update=[epochs]
128
133
Update error status after this epochs time, 5 by default.
129
134
This parameter affected training speed.
130
135
136
+
131
137
<aname="Chapter_2_2_2"></a>***Work modes***
132
138
133
139
Learning Mode:
@@ -169,6 +175,7 @@ Classifying Mode:
169
175
and outputs is number of neurons in output layer
170
176
}
171
177
178
+
172
179
<aname="Chapter_2_2_3"></a>***Usage examples***
173
180
174
181
Start learning with user's ethalon data file and neuronet options Config=(3,[3,2],2), 10 epochs, 0.1 learning rate and 0.05 momentum, epsilon is 0.01 and stop learning if errors less than 5%, update information in log every 5 epochs:
@@ -183,7 +190,8 @@ Where 'python' is full path to Pyzo Python 3.3.2 interpreter.
183
190
184
191
185
192
<aname="Chapter_3"></a>Preparing data
186
-
--------------
193
+
--------------------------------------
194
+
187
195
188
196
<aname="Chapter_3_1"></a>**ethalons.dat**
189
197
@@ -234,21 +242,21 @@ This is default file with data set for classifying. This file contains tab-delim
234
242
235
243
236
244
<aname="Chapter_4"></a>Report of classificating
237
-
--------------
245
+
------------------------------------------------
238
246
239
247
To classify each of input vectors You must to use --classify key. All columns are used as values of input vectors.
FC.__version__ # Version of current FuzzyClassificator build.
362
-
374
+
363
375
FC.ethalonsDataFile # File with ethalon data samples, 'ethalons.dat' by default.
364
-
376
+
365
377
FC.candidatesDataFile # File with candidates data samples, 'candidates.dat' by default.
366
-
378
+
367
379
FC.neuroNetworkFile # File with Neuro Network configuration, 'network.xml' by default.
368
-
380
+
369
381
FC.reportDataFile # Report file with classification analysis, 'report.txt' by default.
370
-
382
+
371
383
FC.bestNetworkFile # Where best network saved, 'best_nn.xml' by default.
372
-
384
+
373
385
FC.bestNetworkInfoFile # Where information about best network saved, 'best_nn.txt' by default.
374
-
386
+
375
387
FC.epochsToUpdate # Epochs between error status updated, 5 by default.
376
-
388
+
377
389
FC.ignoreColumns # List of ignored columns. Empty list [] by default, e.g. FC.ignoreColumns = [1, 3].
378
-
390
+
379
391
FC.ignoreRows # List of ignored rows. [1] by default, e.g. FC.ignoreRows = [1, 3].
380
-
392
+
381
393
FC.sepSymbol # Separator symbol. TAB symbol '\t' used by default.
382
-
394
+
383
395
FC.reloadNetworkFromFile # Reload or not Neuro Network from file before usage. False by default.
384
-
396
+
385
397
FC.noFuzzyOutput # Show results with fuzzy values too if False (default). Show only real values in report if True.
386
398
399
+
FC.showExpected # Show expected results in Classify mode. WARNING! Use only if your dat-file contains columns with expected results to avoid errors!
400
+
401
+
387
402
<aname="Chapter_5_2"></a>**PyBrainLearning.py**
388
403
389
404
This is library for work with fuzzy neural networks. You can import and re-use module in your programm if you'd like to realize own work with networks.
390
405
391
406
All routines to work with fuzzy neural networks realized in *FuzzyNeuroNetwork()* class. It contains next main methods:
392
407
393
-
-*ParseRawDataFile()* - used for parsing file with text raw data,
394
-
-*PrepareDataSet()* - used for converting parsed raw-data into PyBrain dataset format,
395
-
-*CreateNetwork()* - used for creating PyBrain network,
396
-
-*CreateTrainer()* - used for creating PyBrain trainer,
397
-
-*SaveNetwork()* - used for saving network in PyBrain xml-format,
398
-
-*LoadNetwork()* - used for loading network from PyBrain xml-format file,
399
-
-*Train()* - realize network training mechanism,
400
-
-*CreateReport()* - creates text report after classification vector-candidates.
408
+
import PyBrainLearning as FL # Import supporting module.
409
+
410
+
FL.ParseRawDataFile() # Used for parsing file with text raw data.
411
+
412
+
FL.PrepareDataSet() # Used for converting parsed raw-data into PyBrain dataset format.
413
+
414
+
FL.CreateNetwork() # Used for creating PyBrain network.
415
+
416
+
FL.CreateTrainer() # Used for creating PyBrain trainer.
417
+
418
+
FL.SaveNetwork() # Used for saving network in PyBrain xml-format.
419
+
420
+
FL.LoadNetwork() # Used for loading network from PyBrain xml-format file.
421
+
422
+
FL.Train() # Realize network training mechanism.
423
+
424
+
FL.CreateReport() # Create text report after classification vector-candidates.
401
425
402
-
You can import this class and use its methods in other projects.
403
426
404
427
<aname="Chapter_5_3"></a>**FuzzyRoutines.py**
405
428
406
429
Library contains some routines for work with fuzzy logic operators, fuzzy datasets and fuzzy scales.
407
430
408
431
There are some examples of working with fuzzy library after importing it. Just copying at the end of FuzzyRoutines and run it.
409
432
433
+
410
434
<aname="Chapter_5_3_1"></a>***Work with membership functions***
411
435
412
436
Usage of some membership functions (uncomment one of them):
@@ -444,6 +468,7 @@ Calculating some function's values in [0, 1]:
444
468
res = funct.mju(xPar) # calculate one value of MF with given parameters
0 commit comments