% set the number of address bits for the majority-on problem
NumFeat=5;
% set the number of observations
NumObs=1250;
% Now create the majority on dataset
Data=(rand(NumObs,NumFeat)<0.5)+0;
% Determine output
Output=(sum(Data,2)>NumFeat/2)+0;
% There are three data types that can be input into the CCEA
% 1) continuous or ordinal data (ContData)
% 2) nominal data (Cat
% 3) binary data or any feature where the user only wants one value
% assigned to a feature in a conjunctive clause
% For each data type list the corresponding columns in the Data matrix that
% correspond to the data type of the feature (i.e., if the data in columns
% 1 and 3 are ordinal or continuous then ConOrdData=[1 3]).;
ContOrdData=[]; % To be used for ordinal or continuous features
NomData=[]; % To be used for nominal features
BinData=1:NumFeat; % To be used for binary features or any feature where
% the user only wants one value associated with the
% conjunctive clause.
% Set the target class
TargetClass=Output==1;% In this case only data with an output of 1 will be
% analyzed
% Run my algorithm convert the data to binary
[DataBin, Param, DataSum]=Data2BinaryTarget(Data, Output, ...
ContOrdData, NomData, BinData, TargetClass);
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% Set the CCEA parameters
% The below settings are appropriate but not necessarily optimal for the
% 6-bit multiplexer dataset. The user can play with the parameter settings
% to find the best combination for a given dataset.
% Note: there are numerous input parameters for the CCEA. The idea is to
% give the user control over the optimal way to search a dataset. For
% instance, Datasets with binary features may require fewer age layers and
% fewer generations between novel generations; while datasets with
% continuous or ordinal features may require more age layers and more
% generations between novel generations.
Param.NumNewPop=NumFeat; % The # of new offspring created every Param.GENn
Param.TotGens=30; % Total # generations to run the CCEA
% Param.FeatLabels=[]; % The feature labels (not needed for CCEA but
% necessary for understanding the features)
Param.BestFit=false(); % Will record the best hypergeometric fitness for
% each CC order each generation
Param.ALna=5; % The # of layers that are not archived
% (helps maintain diversity)
Param.GENn=3; % The # of generations until a new population of offspring
% are created.
Param.NonArchLMax=Param.NumNewPop*1;% Max population per non-archive layer
Param.ArchOff=Param.NonArchLMax*Param.ALna; %The max # of Archive offspring
%created each generation
Param.Px=0.5; % Probability of crossover
Param.Pwc=0.75; % probability that feature selected for mutation will be
% removed from the conjunctive clause
Param.Pm=1/NumFeat; % probability that a feature will be selected for
% mutation. Only if the parent is selected for mutation
% instead of crossover.
Param.TournSize=3; % # of parents with replacement that are in the
% tournament to mate with the parent. Only most fit will
% mate.
% set the number of address bits for the majority-on problem
NumFeat=5;
% set the number of observations
NumObs=1250;
% Now create the majority on dataset
Data=(rand(NumObs,NumFeat)<0.5)+0;
% Determine output
Output=(sum(Data,2)>NumFeat/2)+0;
% There are three data types that can be input into the CCEA
% 1) continuous or ordinal data (ContData)
% 2) nominal data (Cat
% 3) binary data or any feature where the user only wants one value
% assigned to a feature in a conjunctive clause
% For each data type list the corresponding columns in the Data matrix that
% correspond to the data type of the feature (i.e., if the data in columns
% 1 and 3 are ordinal or continuous then ConOrdData=[1 3]).;
ContOrdData=[]; % To be used for ordinal or continuous features
NomData=[]; % To be used for nominal features
BinData=1:NumFeat; % To be used for binary features or any feature where
% the user only wants one value associated with the
% conjunctive clause.
% Set the target class
TargetClass=Output==1;% In this case only data with an output of 1 will be