Professional Documents
Culture Documents
Discipulus 5.0
Discipulus, and RML are trademarks of Register Machine Learning Technologies, Inc.
Copyright 1998-2010 Register Machine Learning Technologies, Inc.
Information in this document is subject to change without notice. The software described in this document isfurnished under a license
agreement. The software may be used and copied only in accordance with the termsof those agreements. No part of this publication
may be reproduced, stored, in a retrieval system, ortransmitted in any form or any means electronic or mechanical, including
photocopying and recording for anypurpose other than the purchasers personal use without the written permission of Register
Machine LearningTechnologies, Inc.
Introduction
This document describes the declaration of all functions that are decompiled by
Discipulus. Discipulus Evolved Functions are one way to apply a program or team
evolved by Discipulus to new data. There is no difference between a best team interface
and a best program interface.
A Discipulus Evolved Function is just that, a function in one of several programming
languages that encapsulates a Discipulus evolved program or team. Once created, you
may embed a Discipulus Evolved Function into your code and call it as an ordinary
function.
In brief summary, there are four different types of Discipulus Evolved Functions.
Discipulus creates an Evolved Function type that is appropriate for the type of fitness
function you used to train the evolved program or team that you are converting to an
Evolved Function. Thus, there is a different function interface for:
1. Regression Problem Types
2. Classification Problem Types
3. Ranking Problem Types
4. Logistic Regression Problem Types
Decompiled programs for each problem type, there are five different formats in which
you may export decompiled programs:
1. C
2. C Assembler
3. C#
4. Java
5. Pascal (Delphi)
(For ranking functions, no C Assembler decompilation is available.)
Click on the Save Decompiled Program (circled in orange) button. From the resulting
window, select the language (circled in magenta) you wish to compile to and the path and
file name for the decompiled program.
Creating Decompiled Best Teams. You create decompiled best programs from
Discipulus from the Interactive Evaluator as follows:
From the Team Solutions tab of the Results window, click the Save Code button (circled
in orange). From the Save Decompiled Programs window that pops up, select the
computer language (circled in magenta) and location for the save.
Table of Contents
Introduction......................................................................................................................... 3
Table of Contents................................................................................................................ 5
1
2.1
2.2
2.3
2.4
2.5
2.6
3.2
3.3
3.4
3.5
3.6
4.2
4.3
4.4
4.5
4.6
Example
A C code example for calling a Discipulus regression function that was evolved with
three input values follows:
float v[]={0.5,20.3,15.0};
float result;
result=DiscipulusCRegressionFunction(v);
Example
A function decompiled into C# code is saved as class within namespace Discipulus. The
filename of *.cs file reflects the name of the class, The name is derived from the name
provided to Discipulus while saving the decompiled program. An example for calling a
Discipulus C# regression function that was evolved with three input values follows:
1. Include the class to your compilation unit using using directive in the very
beginning of your *.cs file:
using Discipulus;
clReg =
new Class_Name()
Example
Java language requires a method to be part of certain Java class. Discipulus decompiles
its solution to a package com.rmltech.EvolvedSolution. The name of the class is derived
from the file name gives during decompilation process.
A Java code example for calling a Discipulus Java regression function that was evolved
with three input values follows:
1. Import generated class in the beginning of your *.java source file:
import com.rmltech.EvolvedSolution;
clReg =
new Class_Name()
double result =
clReg.DiscipulusJavaRegressionFunction(inputVector);
Example
The Delphi/Pascal function is wrapped into a unit bearing a name that is exactly the same
as the name specified during decompilation process. The unit similar to this is created:
unit Unit2;
function DiscipulusPascalRegressionFunction (v: array of Double):
Double;
interface
An example for calling a Discipulus Pascal regression function that was evolved with
three input values requires:
1. Adding generated unit to uses list:
uses , Unit2, ;
2. Preparing the array with data that are to be passed to decompiled function:
var
v: array of double; // declaring array
. . .
SetLength(v, 3); // set array to be 3 element long
v[0] := 0.5;
v[0] := 20.3;
v[0] := 15.0;
regResult := DiscipulusPascalRegressionFunction(v);
Threshold: The threshold value that was used during evolution to determine if the
actual output from the evolved program was in class one or class zero.
ActualOutput: Threshold value plus number of team members that predict class 1
minus number of team members that predict class 0. (Note that a single evolved
program is a team of 1. So with a Threshold of 0.5, the output for class one would
be 1.5 and the output for class zero would be -0.5.)
Confidence: The confidence value for the calculated class prediction. This
represents the strength of our belief that the class of the given input vector, v, that
is returned from this function is correct. Thus, if this function returns Class = 1.0
and Confidence = 0.95, that means we are 95% confident that the vector, v, is in
Class 1.
Class1Votes: Number of team members that predict class 1 for the input vector v.
Class0Votes: Number of team members that predict class 0 for the input vector v.
10
Example
An example of calling this interface for a C Function evolved by Discipulus using three
inputs follows:
float v[]={0.5,20.3,15.0};
float Threshold;
float ActualOutput;
long NumberOfExamples;
double Confidence; int Class 1Votes; int Class0Votes; float
result;
result=DiscipulusCFunction(v,Threshold,ActualOutput,
NumberOfExamples,Confidence,
Class1Votes,Class0Votes);
Example
An example for calling the interface where the function was evolved with three
inputs follows:
float v[]={0.5,20.3,15.0};
float Threshold;
float ActualOutput;
long NumberOfExamples;
double Confidence;
int Class 1 Votes;
int Class0 Votes;
float result;
11
Example
Here is an example of calling a Discipulus C# Classification function for an evolved
program that was trained with three inputs:
using Discipulus;
float[] inputVector = { 0.5F, 20.3F, 15.0F };
float
long
NumberOfExamples=0;
double
Confidence=0;
int
Class1Votes=0, Class0Votes=0;
Class_Name
clClass =
new Class_Name()
float result =
clClass.DiscipulusCSharpClassificationFunction(v, ref
Threshold, ref ActualOutput, ref NumberOfExamples, ref
Confidence, ref Class1Votes, ref Class0Votes);
12
clClassi =
new Class_Name()
result =
clClassi.discipulusJavaClassificationFunction(inputVector);
System.out.println(result.getResult());
System.out.println(result.getConfidence());
System.out.println(result.getActualOutput());
System.out.println(result.getThreshold());
System.out.println(result.NumberOfExamples());
System.out.println(result.getClass0Votes());
System.out.println(result.getClass1Votes());
Example
Here is an example of calling a Discipulus Pascal/Delphi Classification function for an
evolved program that was trained with three inputs. As in regression function, the proper
unit file is created:
var
V: array of Double;
Threshold: Double;
ActualOutput: Double;
NumberOfExamples: Integer;
Confidence: Double;
Class1Votes: Integer;
Class0Votes: Integer;
13
v[0] := 20.3;
v[0] := 15.0;
14
15
LogisticProbabilityOfTargetClass,
float &
OtherProbabilityOfTargetClass,
ActualOutputDecisionThreshold,
float &
LogisticProbabilityOutDecisionThres,
float &
OtherProbabilityOutDecisionThres,
float &
NormalizedDecisionThreshold,
float &
CostOfFalseNegative,
float &
CostOfFalsePositive
Example
Here is an example of calling a C Ranking function for an evolved program that was
trained with three inputs.
float v[]={0.5,20.3,15.0};
float
ActualOutput = 0 ;
float
LogisticProbabilityOfTargetClass = 0;
float
OtherProbabilityOfTargetClass =0
float
UserSetDecisionThreshold =0;
float
ActualOutputDecisionThreshold =0;
float
LogisticProbabilityOutDecisionThres=0;
float
OtherProbabilityOutDecisionThres =0;
float
NormalizedDecisionThreshold =0;
float
CostOfFalseNegative =0;
float
CostOfFalsePositive =0;
16
Example
Here is an example of calling a C# Ranking function for an evolved program that was
trained with three inputs:
1. Include the class to your compilation unit using using directive in the very
beginning of your *.cs file.
using Discipulus;
17
LogisticProbabilityOfTargetClass =0;
float
ActualOutput=0;
long
OtherProbabilityOfTargetClass=0;
float
UserSetDecisionThreshold = 0 ;
float
ActualOutputDecisionThreshold = 0;
float
LogisticProbOutputDecisionThres = 0;
float
OtherProbOutputDecisionThres = 0;
float
NormalizedDecisionThreshold = 0;
float
CostOfFalseNegative = 0 ;
float
CostOfFalsePositive = 0 ;
Class_Name
clClass =
new Class_Name()
18
clRanking =
new Class_Name()
Double;
var ActualOutputDecisionThreshold:
Double;
var LogisticProbOutputDecisionThres:
var OtherProbOutputDecisionThres:
var NormalizedDecisionThreshold:
var CostOfFalseNegative: Double;
var CostOfFalsePositive: Double
): Double;
Example
19
Double;
Double;
Double;
Double;
ActualOutputDecisionThreshold:
Double;
LogisticProbOutputDecisionThres:
OtherProbOutputDecisionThres:
NormalizedDecisionThreshold:
Double;
Double;
Double;
CostOfFalseNegative: Double;
CostOfFalsePositive: Double ;
Result: Double;
Begin
. . .
SetLength(v, 3); // set array to be 3 element long
v[0] := 0.5;
v[0] := 20.3;
v[0] := 15.0;
Result := DiscipulusPascalRankingFunction(V,
ActualOutput,
LogisticProbabilityOfTargetClass,
OtherProbabilityOfTargetClass,
UserSetDecisionThreshold,
ActualOutputDecisionThreshold,
LogisticProbOutputDecisionThres,
OtherProbOutputDecisionThres,
NormalizedDecisionThreshold,
CostOfFalseNegative,
CostOfFalsePositive );
End;
20
21