4
MATLAB SOFTWARE TOOL FOR NEURO-FUZZY IDENTIFICATION AND DATA ANALYSIS. Ver. 0.1 BY Gianluca Bontempi- PhD Student - IRIDIA ULB Bruxelles, Belgium e- mail:[email protected] Mauro Bitattari - Graduate Students , Dipartimento di Eletronica , Politecnico di Milano, Italy, GENERAL DESCRIPTION This software is the preliminary version of a larger project, whose complete version will be available in the next months. It has been implemented in the Matlab language ver. 4.2. This version performs the identification of a input-output mapping, available in the form of a set of N input-output examples, with a fuzzy architecture, inspired to Takagi-Sugeno approach [1] [2] [4]. The fuzzy architecture is characterized by a set of rules, which are properly initialized and tuned by a learning algorithm. The rules are in the form: 1) if input1 is A11 and input 2 is A12 then output =f1(input1,input2) 2) if input1 is A21 and input 2 is A22 then output =f2(input1,input2) ............. where Aij are parametric membership function. The program provides a set of structural alternatives in the definition of the fuzzy model: the user may choose the shape of the membership functions of the antecedents (gaussian or triangular), the parametric form of the consequent (constant or linear f), the combination method of the rules (normalized or not). Further, it is possible to choose between two different clustering policies, k_mean or Hyperplane Fuzzy Clustering [3], to provide the identification algorithm with good initial values of the centers and bases of the membership functions. The program searchs also for the 'right' complexity (number of rules) of the architecture by adopting a procedure of cross- validation on the available data set. It starts with a minimal number of rules and at each step increase the number of rules by restarting the global procedure, until a maximum number of rules is reached (the user is free to set properly what is the desired range of complexity to range over). Then each structure is

fuzz

Embed Size (px)

Citation preview

Page 1: fuzz

MATLAB SOFTWARE TOOL FOR NEURO-FUZZY IDENTIFICATION AND DATA ANALYSIS. Ver. 0.1BYGianluca Bontempi- PhD Student - IRIDIA ULB Bruxelles, Belgium e-mail:[email protected] Bitattari - Graduate Students , Dipartimento di Eletronica , Politecnico di Milano, Italy,

GENERAL DESCRIPTIONThis software is the preliminary version of a larger project, whose complete version will be available in the next months. It has been implemented in the Matlab language ver. 4.2.This version performs the identification of a input-output mapping, available in the form of a set of N input-output examples, with a fuzzy architecture, inspired to Takagi-Sugeno approach [1] [2] [4]. The fuzzy architecture is characterized by a set of rules, which are properly initialized and tuned by a learning algorithm. The rules are in the form:1) if input1 is A11 and input 2 is A12 then output =f1(input1,input2)2) if input1 is A21 and input 2 is A22 then output =f2(input1,input2).............where Aij are parametric membership function.The program provides a set of structural alternatives in the definition of the fuzzy model: the user may choose the shape of the membership functions of the antecedents (gaussian or triangular), the parametric form of the consequent (constant or linear f), the combination method of the rules (normalized or not). Further, it is possible to choose between two different clustering policies, k_mean or Hyperplane Fuzzy Clustering [3], to provide the identification algorithm with good initial values of the centers and bases of the membership functions.The program searchs also for the 'right' complexity (number of rules) of the architecture by adopting a procedure of cross-validation on the available data set. It starts with a minimal number of rules and at each step increase the number of rules by restarting the global procedure, until a maximum number of rules is reached (the user is free to set properly what is the desired range of complexity to range over). Then each structure is characterized by its error in generalization, estimated by a procedure of cross-validation and the optimal number of rules is searched by comparing the cross validation error obtained at different levels of complexity. At the end of the global training phase, the cross validation error is plotted against the number of rules used and the user is asked to choose the level of complexity at which the fuzzy system looks to perform better (fig.1): after this, the fuzzy system of the chosen complexity is identified from scratch by using the whole data set. The model is now ready to be used for prediction on new samples.

Page 2: fuzz

0 5 10 15 20 25 300.4

0.6

0.8

1

1.2

1.4

1.6

1.8

fig. 1. Cross-validation error vs. complexity diagram

REFERENCES:[1] Bersini H., Bontempi G., Decaestecker C. (1995). Comparing RBF and Fuzzy Inference Systems on Theoretical and Practical Basis in F.Fogelman-Soulie', P. Gallinari (Eds.) ICANN '95,International Conference on Artificial Neural Networks, Paris , vol. 1, pp. 169-174 [2] Bersini H., Bontempi G. (1996) Now comes the time to defuzzify neuro-fuzzy models IRIDIA - ULB Technical Report 96-7 (submitted to Fuzzy Sets and Systems)[3] Bezdek J.C., Anderson I.M., An Application of the c-Varieties Clustering Algorithms to Polygonal Curve Fitting, IEEE Trans. Syst., Man Cybern.,vol.SMC-15,no 5. pp 637-641 Sept/Oct 1985.[4] Sugeno M. , Yasukawa T., A Fuzzy-Logic-Based Approach to Qualitative Modeling, IEEE Trans. Fuzzy Syst., vol.1 no 1,Febr 1993.

NOTES AND TIPS (names of Matlab variables are in bold): The desired feature must be selected before running the program 'uncommenting' the corresponding line in the module fuzzy_b.m. An analogous graphic version is provided in the file fuzzy_g.m. Three options (mutually exclusive) are available :

pr='comp_err';pr='one_mod'; pr='evaluate';

Page 3: fuzz

With pr=‘comp_err’ the program searches for the best structure (in terms of number of rules) by ranging the models over the set [comp_min comp_max]. comp_min and comp_max represent the extremes of the complexity interval (minimum and maximum number of rules, respectively).With pr=‘one_mod’ a particular structure whose number of rules is provided in the variable comp, is identified starting from the available training data set.For these two modes, the user can choice the desired model configuration in terms of membership shape (gaussian or triangular), local model structure (constant or linear), rule of model composition (weigthed or not), initialization procedure (k-means or fuzzy clustering).With pr=‘evaluate’ the program evaluates the performance of a model (contained in matlab file specified with the variable tmod_id) on a test set (contained in the matlab file specified with the variable in_id). The predicted output is saved in the file pred_id.

The samples matrix must be named data and must be saved as a matlab .mat file whose name and path must be provided to the program through the reserved line in the module fuzzy_b.m.The data matrix is a matrix [no_data, no_var+1] where no_data is the number of rows and no_var+1 is the number of columns. no_data represents the number of samples available, no_var is the number of inputs while the number of outputs is always restricted to one.All the inputs and the output should be scaled between -1 and 1. Automatic scaling will be a feature of the next version.The results of the computation are the 3 matrices: centers bases and par, which, containing respectivly the coordinates of the centers and the bases of the membership functions and the parameters of the output model of the rules, give a description of the fuzzy system just identified. The 3 matrices centers, bases and par are not automatically saved to disk at the end of the computation but they are avilable in the memory space of Matlab.

N.B. For any questions,bugs, problesm do not hesitate to contact the authors