Machine learning

Almost all machine learning methodologies create models of the things they have learned that are opaque. So, for instance, the knowledge contained in a Neural Network, or a Bayesian model can not easily be extracted for other uses or to perform a sanity check that the model created makes sense. While some models are used to make classifications or predictions, another valid use of machine learning is to gain some understanding of the relationships in the data, or the system that created it. This is hard to do with most learning methodologies. The Machine learning technique we've developed and used creates models in DARL. We have variants that can perform supervised, unsupervised, reinforcement and association learning. The first version we will roll out with DARL will contain just supervised learning. The others will follow shortly. Our supervised learning algorithm requires only that you specify the types of the inputs and the single predicted or categorized output. A key part of Fuzzy Logic Rule Induction is the determination of the number and type of fuzzy sets for numeric values. This is now performed entirely automatically. Machine learning can be performed using either SaaS resources or local libraries depending on the license purchased.

An example - Fisher's Iris data

This is the initial DARL code. The "pattern" declaration defines how to find patterns in the source XML or Json data. The single ruleset is annotated with "supervised" to say that rules will be generated with supervised learning, and contains only input and output definitions, matching up with the field names of the data in the training source.

pattern "//Iris";

ruleset iris supervised
{
    input numeric petal_length;
    input numeric sepal_length;
    input numeric petal_width;
    input numeric sepal_width;

    output categorical class;

}

mapinput petal_length "petal_length";
mapinput petal_width "petal_width";
mapinput sepal_length "sepal_length";
mapinput sepal_width "sepal_width";

mapoutput class "class";

wire petal_length iris.petal_length;
wire petal_width iris.petal_width;
wire sepal_length iris.sepal_length;
wire sepal_width iris.sepal_width;
wire iris.class class;

After machine learning the ruleset now contains machine generated rules and fuzzy sets, along with comments describing the performance of the learning run that generated them.

pattern "//Iris";

ruleset iris supervised
{
    // Generated by DARL rule induction on  26/04/2015 14:48:32.
    // Train correct:  92.76% on 152 patterns.
    // Percentage of unknown responses over all patterns: 0.00
    input numeric petal_length {{small, -Infinity,1,4.4},{medium, 1,4.4,6.9},{large, 4.4,6.9,Infinity}};
    input numeric petal_width {{small, -Infinity,0.1,1.3},{medium, 0.1,1.3,2.5},{large, 1.3,2.5,Infinity}};
    input numeric sepal_length {{small, -Infinity,4.3,5.8},{medium, 4.3,5.8,7.9},{large, 5.8,7.9,Infinity}};
    input numeric sepal_width {{small, -Infinity,2,3},{medium, 2,3,4.4},{large, 3,4.4,Infinity}};

    output categorical class {"Iris-setosa","Iris-versicolor","Iris-virginica"};

    if petal_width is small  then class will be "Iris-setosa" confidence 1; // examples: 50
    if petal_width is medium  and petal_length is medium  then class will be "Iris-versicolor" confidence 0.793650793650794; // examples: 63
    if petal_width is medium  and petal_length is large  then class will be "Iris-virginica" confidence 1; // examples: 4
    if petal_width is large  then class will be "Iris-virginica" confidence 1; // examples: 30
}

mapinput petal_length "petal_length";
mapinput petal_width "petal_width";
mapinput sepal_length "sepal_length";
mapinput sepal_width "sepal_width";

mapoutput class "class";

wire petal_length iris.petal_length;
wire petal_width iris.petal_width;
wire sepal_length iris.sepal_length;
wire sepal_width iris.sepal_width;
wire iris.class class;

The created ruleset is now ready to be used immediately with DarlInference and, with the addition of text and formating, with DarlForms.