[译]DARL语言及其在线模糊逻辑专家系统引擎
By robot-v1.0
本文链接 https://www.kyfws.com/ai/the-darl-language-and-its-online-fuzzy-logic-exper-zh/
版权声明 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
- 14 分钟阅读 - 6605 个词 阅读量 0DARL语言及其在线模糊逻辑专家系统引擎(译文)
原文地址:https://www.codeproject.com/Articles/1239707/The-DARL-Language-and-its-Online-Fuzzy-Logic-Exper
原文作者:AndyEdmonds
译文由本站 robot-v1.0 翻译
前言
A free service makes it possible to use a fuzzy logic expert system online. We’ll go through an example of coding in .NET core to access this, and look at some of the features of the engine and the DARL language.
免费服务使在线使用模糊逻辑专家系统成为可能.我们将通过.NET核心编码示例来访问它,并研究引擎和DARL语言的某些功能.
介绍(Introduction)
当AI的第一项工作在50年代完成时,有两个线程:逻辑和语言,以及复制性.最早的工作是在模拟的神经元中,使用带有电机和可变电阻器的奇怪的机电设备,但是不久之后,专家系统开始接手.神经网络在80年代风靡一时,再加上诸如GA和GP等受自然启发的想法,再一次成为了深度学习的当月风格,但由于维护和维护的复杂性,专家系统在随后的几年中逐渐消失. “知识工程师"创建他们的要求.(When the very first work on AI was done in the ’50s, there were two threads: logic and language, and copying nature. The earliest work was in simulated neurons, using strange electrical mechanical devices with motors and variable resistors, but pretty soon, expert systems began to take over. Neural nets resurged in the ’80s, along with other nature-inspired ideas like GA and GP, and once again they are the flavor of the month with deep learning, but expert systems faded in the intervening years because of the complexity of their maintenance and the requirement for “knowledge engineers” to create them.)
仍在使用专家系统.如果您使用一般方程求解和数学运算产品之一,那么您正在使用专家系统.该应用程序非常适合老式的专家系统,因为数学定律永远不会改变-因此无需维护!(There are still expert systems in use. If you use one of the general equation solving and mathematical manipulation products, you are using an expert system. This application is perfect for the old-fashioned kind of expert systems, because the laws of mathematics will never change - so no maintenance!)
DARL试图将专家系统拖入21世纪. DARL最初是为解决机器学习今天仍然存在的问题而创建的:您如何审核经过训练的神经网络?即如果您使用机器学习来创建在实际示例中使用的模型,那么如何确保它不会意外地做坏事,例如将错误的人识别为潜在的恐怖分子,或拒绝向少数群体提供贷款?神经网络和其他类似技术产生的模型是"黑匣子”. DARL的设计者找到的答案是使用模糊逻辑规则作为模型表示机制.存在用于对这些规则进行监督,非监督和强化学习的算法.(DARL is an attempt to drag experts systems into the 21st century. DARL was initially created as a solution to a problem that still exists today in Machine Learning: how do you audit a trained Neural network? I.e. if you use Machine Learning to create a model that you use in a real world example, how do you ensure it doesn’t accidentally do something bad, like identify the wrong person as a potential terrorist, or deny a loan to a minority group? Neural networks and other similar techniques produce models that are “black boxes”. The answer the designer of DARL found was to use Fuzzy Logic Rules as the model representation mechanism. Algorithms exist to perform Supervised, Unsupervised and Reinforcement learning to these rules.)
DARL就是从此发展起来的.最初,模型是用XML编码的,但是后来创建了成熟的语言,以便所有常用工具(如编辑器,解释器等)都可以与模型一起使用.这些规则很容易理解,因此审核它们的意外效果很简单.例如,一家金融公司有可能通过机器学习模型来确定贷款资格,然后发布DARL代码,或者至少在法庭上提供该代码,以作为对偏见指控的辩护.(DARL grew out of that. Initially, the models were coded in XML, but later a fully fledged language was created so that all the usual tools like editors, interpreters, etc. could be used with the models. The rules are very easy to understand, so auditing them for unexpected effects is simple. It would be possible, for instance, for a finance company to machine learn a model to, say, determine loan qualification and then publish the DARL code, or at least provide it in court as a defence to charges of bias.)
因此,DARL既可以用来进行数据挖掘,也可以用来手工创建模型.它在实现这两个目的方面都是独一无二的.(So DARL became something you could use both to data mine to, and something you could create models with by hand. It is unique in serving both purposes.)
在本文中,我们将查看DARL的免费在线资源,并使用预先编写的DARL片段来计算英国居民的税金,以展示DARL和引擎的某些功能.(In this article, we are going to look at the free online resources for DARL, and use a pre-written piece of DARL that calculates taxes for UK residents to demonstrate some of the features of DARL and the engine.)
不确定(Uncertainty)
所有机器学习都有内在的不准确性.如果可以通过某种分析过程来对特定过程进行建模,那么没有人会想到使用ML.仅在模型非常不确定的情况下使用.通常,数据是嘈杂的,并且模型本身带有所谓的"模型错误",这是不完善的机器学习的一部分.(All machine learning has inherent inaccuracies. If a particular process can be modelled by some kind of analytical process, no one in their right mind would use ML. It is only used where the model is very uncertain. Usually, the data is noisy, and the model itself carries so called “model errors” as part of imperfect machine learning.)
因此,用于ML的建模语言也必须隐含支持不确定性. DARL有许多方法可以处理不确定性.它支持模糊逻辑,因此支持部分真值的概念以及可能论的相关数学学科.它支持模糊算术,因此它支持区间数学,公差,模糊集等.在使用DARL及其引擎时,您可以输入" crisp"值,即确定的数值或分类值,或者可以使用它们进行注释不确定性:如果值不确定,请提供一个区间或模糊数.(So a modelling language for ML must have implicit support for uncertainty too. DARL has many ways to handle uncertainty. It supports Fuzzy logic, so supports the idea of partial truth, and the associated mathematical discipline of Possibility Theory. It supports Fuzzy Arithmetic, so it supports interval maths, tolerances, fuzzy sets, etc. In using DARL and its engine, you can input ‘crisp’ values, i.e., numeric or categorical values you are certain of, or you can annotate them with uncertainty: so supply an interval or a fuzzy number if a value is uncertain.)
还有更多的可能性. DARL不久将具有时间输入和输出,支持"模糊时间",并且DARL也可以通过多种方式处理文本输入,但是这里的示例将集中在分类和数字值上.(There are more possibilities too. DARL will shortly have temporal inputs and outputs, supporting “fuzzy time” and DARL can handle text inputs as well in various ways, But our example here will concentrate on just categorical and numeric values.)
DARL计划(A DARL Program)
DARL程序以最简单的形式包含一个(In its simplest form, a DARL program consists of a single) Ruleset
.这是构成功能块的规则,输入和输出定义的集合.(. This is a collection of rules, input and output definitions that form a functional block.)
ruleset UKTAXNI
{
}
在 - 的里面(Inside the) ruleset
,您可以定义本地输入和输出.对于税收示例,它们看起来像这样:(, you define the local inputs and outputs. They look like this for the tax example:)
//Input definitions
input numeric EARNED_INCOME {{Low , 0.000, 0.000}, {High , 1000000.000, 1000000.000}};
input numeric DIVIDEND_INCOME {{Low , 0.000, 0.000}, {High , 1000000.000, 1000000.000}};
input numeric AGE_YEARS {{Low , 0.000, 0.000}, {High , 100.000, 100.000}};
input categorical MARRIED {True, False};
input categorical BLIND {True, False};
//Output definitions
output numeric TOTAL_ALLOWANCES ;
output numeric TOTAL_INCOME ;
output numeric EARNED_TAX ;
output numeric DIVIDEND_TAX ;
output numeric TOTAL_TAX ;
output numeric TOTAL_TAX_MONTHLY ;
output numeric NI ;
output numeric NI_MONTHLY ;
output numeric EARNED_INCOME_AFTER_ALLOWANCES ;
output numeric TOTAL_INCOME_AFTER_ALLOWANCES ;
output numeric TOTAL_YEARLY_TAKE_HOME ;
output numeric TOTAL_MONTHLY_TAKE_HOME ;
output numeric YEARLY_EMPLOYERS_NI ;
output numeric TAX_TAKE_PERCENT ;
在黑暗中(In DARL, within a) ruleset
,任何元素都没有必要的顺序.您可以声明输入或输出,或在任何地方编写规则.有大量的规则运行时处理过程来建立依赖关系,查找循环引用等.因此,您无需考虑规则或定义的顺序.但是,如果保持输入,输出,常量和规则的格式,则内容将更容易阅读.(, there is no necessary order for any element. You can declare an input or output, or write a rule anywhere. There is considerable runtime processing of rules to establish dependencies, look for circular references, etc. Because of this, you do not need to consider sequence of rules or definitions. However, things are much easier to read if you keep to the format of inputs, outputs, constants and then rules.)
在上面的示例中,我们获得了数字和分类输入以及数字输出.(In the above example, we’ve got numeric and categorical inputs and numeric outputs.)
input numeric EARNED_INCOME {{Low , 0.000, 0.000}, {High , 1000000.000, 1000000.000}};
定义一个数字输入(defines a numeric input called) EARNED_INCOME
定义了两个模糊集,称为低和高.在示例中未使用这些集,但它们通过定义输入的预期范围来帮助进行后处理和问卷调查引擎.(with two fuzzy sets defined, called low and high. The sets aren’t used in the example, but they help post processing and the questionnaire engine by defining the expected range of the input.)
DARL中的变量名称以及注释都遵循C#约定.(Variable names in DARL follow C# conventions, as do comments.)
input categorical MARRIED {True, False};
这是分类输入.定义了两个类别.类别或集的名称不必是C#类型的名称,但是如果不是,则必须将其用引号引起来.(This is a categorical input. Two categories are defined. The names of categories or sets don’t have to be C# type names, but if they are not they must be enclosed in quotations.)
在此规则集中定义了常量.您可以使用常数来表示数字或(There are constants defined in this ruleset. You can use constants to represent numbers or) string
,以便在需要更改的情况下只需要更改一个位置,但是数字或(s so as to need to change only one location if a change is required, but number or) string
文字可以直接使用:(literals can be used directly:)
//numeric constant definitions
constant Basic_Allowance 8105;
constant Allowance_Income_Limit 100000;
constant Blind_Persons_allowance 2100;
constant SixtyFive_74_allowance 9940;
constant AGE_65 65;
constant AGE_75 75;
constant SeventyFive_allowance 10090;
constant Age_related_income_limit 24000;
constant Married_couple_max 7295;
constant Married_couple_min 2800;
constant Higher_rate_threshold 34371;
constant Basic_rate 0.2;
constant Higher_rate 0.4;
constant Additional_rate_threshold 150000;
constant Additional_rate 0.5;
constant Savings_starting_rate_threshold 2560;
constant Savings_rate 0.1;
constant Dividend_upper_rate_threshold 34371;
constant Dividend_additional_rate_threshold 150000;
constant Dividend_ordinary_rate 0.1;
constant Dividend_upper_rate 0.325;
constant Dividend_additional_rate 0.425;
constant Dividend_grossing_up 1.1111111;
constant NI_lower_threshold 7592;
constant NI_upper_threshold 42484;
constant NI_lower_rate 0.12;
constant NI_upper_rate 0.02;
constant NI_lower_total 4187;
constant ZERO 0;
constant Allowance_derating 0.5;
constant Employers_NI_Threshold 7488;
constant Employers_NI_Rate 0.138;
constant One_Hundred 100;
constant Twelve 12;
constant One 1;
constant Ten 10;
//string constant definitions
string MonthlyEmpNIConst "Employers' NI, per month";
此税收示例中的规则如下所示:(The rules in this tax example look like this:)
if AGE_YEARS is < AGE_65 and BLIND is False then TOTAL_ALLOWANCES will be maximum
( Basic_Allowance - maximum( TOTAL_INCOME - Allowance_Income_Limit , ZERO ) * Allowance_derating , ZERO ) ;
if AGE_YEARS is < AGE_65 and BLIND is True then TOTAL_ALLOWANCES will be maximum
( Basic_Allowance + Blind_Persons_allowance -
maximum( TOTAL_INCOME - Allowance_Income_Limit , ZERO ) * Allowance_derating , ZERO ) ;
if AGE_YEARS is >= AGE_65 and BLIND is False and TOTAL_INCOME is <
Allowance_Income_Limit and AGE_YEARS is < AGE_75 then TOTAL_ALLOWANCES will be SixtyFive_74_allowance ;
if AGE_YEARS is >= AGE_75 and BLIND is False and TOTAL_INCOME is <
Allowance_Income_Limit and MARRIED is False then TOTAL_ALLOWANCES will be SeventyFive_allowance ;
if EARNED_INCOME is <= TOTAL_ALLOWANCES then EARNED_TAX will be ZERO ;
if EARNED_INCOME_AFTER_ALLOWANCES is <= Higher_rate_threshold
then EARNED_TAX will be EARNED_INCOME_AFTER_ALLOWANCES * Basic_rate ;
if EARNED_INCOME_AFTER_ALLOWANCES is > Higher_rate_threshold and EARNED_INCOME_
AFTER_ALLOWANCES is <= Additional_rate_threshold then EARNED_TAX will be
Higher_rate_threshold * Basic_rate + ( EARNED_INCOME_AFTER_ALLOWANCES -
Higher_rate_threshold ) * Higher_rate ;
if EARNED_INCOME_AFTER_ALLOWANCES is > Additional_rate_threshold then
EARNED_TAX will be Higher_rate_threshold * Basic_rate +
( Additional_rate_threshold - Higher_rate_threshold ) * Higher_rate +
( EARNED_INCOME_AFTER_ALLOWANCES - Additional_rate_threshold ) * Additional_rate ;
if TOTAL_INCOME_AFTER_ALLOWANCES is <= Dividend_upper_rate_threshold then DIVIDEND_TAX will be ZERO ;
if TOTAL_INCOME_AFTER_ALLOWANCES is > Dividend_upper_rate_threshold and
TOTAL_INCOME_AFTER_ALLOWANCES is <= Dividend_additional_rate_threshold
then DIVIDEND_TAX will be minimum( TOTAL_INCOME_AFTER_ALLOWANCES -
Dividend_upper_rate_threshold , DIVIDEND_INCOME * Dividend_grossing_up ) *
( Dividend_upper_rate - Dividend_ordinary_rate ) ;
if TOTAL_INCOME_AFTER_ALLOWANCES is > Dividend_additional_rate_threshold
then DIVIDEND_TAX will be minimum( TOTAL_INCOME_AFTER_ALLOWANCES -
Dividend_upper_rate_threshold , DIVIDEND_INCOME * Dividend_grossing_up ) *
( Dividend_upper_rate - Dividend_ordinary_rate ) ;
if EARNED_INCOME is <= NI_lower_threshold then NI will be ZERO ;
if EARNED_INCOME is > NI_lower_threshold and EARNED_INCOME is <=
NI_upper_threshold then NI will be ( EARNED_INCOME - NI_lower_threshold ) * NI_lower_rate ;
if EARNED_INCOME is > NI_upper_threshold then NI will be
( EARNED_INCOME - NI_upper_threshold ) * NI_upper_rate + NI_lower_total ;
if anything then TOTAL_INCOME will be sum( EARNED_INCOME , DIVIDEND_INCOME * Dividend_grossing_up ) ;
if anything then EARNED_INCOME_AFTER_ALLOWANCES will be maximum
( EARNED_INCOME - TOTAL_ALLOWANCES , ZERO ) ;
if anything then TOTAL_INCOME_AFTER_ALLOWANCES will be maximum
( EARNED_INCOME + DIVIDEND_INCOME * Dividend_grossing_up - TOTAL_ALLOWANCES , ZERO ) ;
if anything then TOTAL_TAX will be sum( EARNED_TAX , DIVIDEND_TAX ) ;
if EARNED_INCOME is <= Employers_NI_Threshold then YEARLY_EMPLOYERS_NI will be ZERO ;
if EARNED_INCOME is > Employers_NI_Threshold then YEARLY_EMPLOYERS_NI
will be ( EARNED_INCOME - Employers_NI_Threshold ) * Employers_NI_Rate ;
if anything then TAX_TAKE_PERCENT will be ( TOTAL_TAX + YEARLY_EMPLOYERS_NI ) /
maximum( TOTAL_INCOME + YEARLY_EMPLOYERS_NI , One ) * One_Hundred ;
if anything then TOTAL_YEARLY_TAKE_HOME will be EARNED_INCOME + DIVIDEND_INCOME - TOTAL_TAX + NI ;
if anything then TOTAL_MONTHLY_TAKE_HOME will be
( EARNED_INCOME + DIVIDEND_INCOME - TOTAL_TAX + NI ) / Twelve ;
if anything then NI_MONTHLY will be NI / Twelve ;
if anything then TOTAL_TAX_MONTHLY will be TOTAL_TAX / Twelve ;
这就是处理英国个人TAX和NI所需的全部内容!(That’s all that is required to handle UK personal TAX and NI!)
规则遵循基本形式:(Rules follow a basic form:)
if <logical tests> then <output> will be <output rhs> [confidence [0-1]];
举一些例子:(To pick some examples:)
if anything then NI_MONTHLY will be NI / Twelve ;
**任何东西(anything)**总是返回一定程度的真相(always returns a degree of truth of) 1
.(.) NI_MONTHLY
是代表每月支付的国民保险的数字输出,此处将其值分配给输出值的算术表达式(is a numeric output representing the national insurance paid per month, and here its value is assigned to an arithmetic expression of the value of the output) NI
除以常数十二.(divided by the constant twelve.)
if EARNED_INCOME is <= TOTAL_ALLOWANCES then EARNED_TAX will be ZERO ;
在这种情况下, “(In this case, “) is
用作比较运算符,显示在右侧的内容取决于左侧的输入或输出.(” is used as a comparison operator, and what appears on the right hand side depends on the input or output to the left. Since) EARNED_INCOME
是数字,可以将其与常量,算术表达式,模糊集定义或模糊数进行比较.(is numeric, it can be compared to a constant, an arithmetic expression, a fuzzy set definition, or a fuzzy number.)
if AGE_YEARS is < AGE_65 and BLIND is False then TOTAL_ALLOWANCES will be maximum
( Basic_Allowance - maximum( TOTAL_INCOME - Allowance_Income_Limit , ZERO )
* Allowance_derating , ZERO ) ;
从长远来看,(In this long rule, “) BLIND is False
“比较”(” compares “) BLIND
“到类别”(” to the category “) False
“.请注意,DARK中的布尔值只是分类变量的示例.(”. Note that booleans in DARL are just examples of categorical variables.)
规则可以选择具有自己的置信度,该信心度控制该单个规则的功能.(Rules can optionally have a degree of confidence of their own, which controls the power of that individual rule.)
在此示例中,还有另一种结构没有用于默认处理,如下所示:(There is also another construction not used in this example for default handling which looks like this:)
otherwise if <logical tests> then <output> will be <output rhs> [confidence [0-1]];
每个输出只能有一个,并且只有在没有其他针对该输出的规则被触发的情况下才会触发它们.(There can only be one of these per output and they are triggered only if no other rules for that output are triggered.)
编辑自己的规则集(Editing Your Own Rulesets)
提供在线编辑器,网址为(An online editor is provided at) Darl.ai/darldevelop(Darl.ai/darldevelop) 可以用来编辑DARL.它具有内置的语法检查器和自动建议.(that can be used to edit DARL. It has a built in syntax checker and auto-suggest.)
在愤怒中使用规则集(Using the Ruleset in Anger)
可以获取本示例中使用的代码(The code used in this example can be obtained) 这里(here) .(.)
它利用了两个类,(It makes use of two classes,) DarlVar
和(and) DarlInfData
是使用API的助手.(which are helpers to use the API.)
DarlVar
是通用类,旨在表示各种各样的输入和输出类型及其相关的不确定性.您可以看到一个定义(is a general purpose class intended to represent a wide range of input and output types and their associated uncertainties. You can see a definition) 这里(here) ,但在此示例中,我们仅使用四个字段.这些是 “(, but in this example, we only use four fields. These are “) name
“,即I/O的名称,(”, the name of the I/O,) dataType
,可以是数字,分类或文本形式,(, which can be numeric, categorical or textual,) Value
,这是作为(, which is the central value as a) string
,值,用于数字不确定性的双精度列表和用于类别不确定性的类别列表,这些类别由成对的类别和确定性值组成.(, values, a list of doubles for numeric uncertainty, and a list of categories for categorical uncertainty, which consist of pairs of categories and certainty values.)
DarlInfData
只保留源DARL代码和(just holds the source DARL code and a list of) DarlVars
对应于要通过规则集运行的数据.(corresponding to the data to run through the ruleset.)
定义了我们将要使用的REST接口(The REST interface that we’re going to use is defined) 这里(here) .(.)
static async Task<List<DarlVar>> PerformInference(string source, List<DarlVar> values)
{
var data = new DarlInfData { source = source, values = values };
var valueString = JsonConvert.SerializeObject(data);
var client = new HttpClient();
var response = await client.PostAsync("https://darl.ai/api/Linter/DarlInf",
new StringContent(valueString, Encoding.UTF8, "application/json"));
var resp = await response.Content.ReadAsStringAsync();
return JsonConvert.DeserializeObject<List<DarlVar>>(resp);
}
这段代码通过一个(This code accesses the inference engine passing a) DarlInfData
用Json编码的类,并接收(class encoded in Json, and receiving a list of) DarlVars
.(.)
其余的演示代码如下所示:(The rest of the demonstration code looks like this:)
static async Task DarlInference()
{
var reader = new StreamReader(Assembly.GetExecutingAssembly().
GetManifestResourceStream("DarlRestExample.UKTaxNI.darl"));
var source = reader.ReadToEnd();
var values = new List<DarlVar>();
values.Add(new DarlVar { name = "EARNED_INCOME",
Value = "15600", dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "DIVIDEND_INCOME",
Value = "15600", dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "AGE_YEARS",
Value = "52", dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "MARRIED",
Value = "False", dataType = DarlVar.DataType.categorical });
values.Add(new DarlVar { name = "BLIND",
Value = "False", dataType = DarlVar.DataType.categorical });
var response = await PerformInference(source, values);
Console.WriteLine("Simple crisp example");
foreach (var r in response)
Console.WriteLine(r.ToString());
values.Clear();
values.Add(new DarlVar { name = "EARNED_INCOME",
values = new List<double> { 12000.0, 18000.0 }, dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "DIVIDEND_INCOME",
values = new List<double> { 18000.0, 19000.0 }, dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "AGE_YEARS",
values = new List<double> { 37.0, 42.0 }, dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "MARRIED",
Value = "False", dataType = DarlVar.DataType.categorical });
values.Add(new DarlVar { name = "BLIND",
categories = new Dictionary<string, double> { { "True", 0.7 },
{ "False", 0.3 } }, dataType = DarlVar.DataType.categorical });
response = await PerformInference(source, values);
Console.WriteLine("Fuzzy Interval example");
foreach (var r in response)
Console.WriteLine(r.ToString());
values.Clear();
values.Add(new DarlVar { name = "EARNED_INCOME",
dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "DIVIDEND_INCOME",
dataType = DarlVar.DataType.numeric, Value = "33000", unknown = true });
values.Add(new DarlVar { name = "AGE_YEARS",
values = new List<double> { 37.0, 42.0 }, dataType = DarlVar.DataType.numeric });
values.Add(new DarlVar { name = "MARRIED",
Value = "False", dataType = DarlVar.DataType.categorical });
values.Add(new DarlVar { name = "BLIND",
Value = "False", dataType = DarlVar.DataType.categorical });
response = await PerformInference(source, values);
Console.WriteLine("Unknown handling example");
foreach (var r in response)
Console.WriteLine(r.ToString());
values.Clear();
}
从嵌入式资源文件加载DARK源后,以上代码分为三个部分.(The above code has three sections after the DARL source is loaded from an embedded resource file.)
首先,一组(In the first, a set of) DarlVars
创建匹配的输入(are created matching the inputs of the) ruleset
并将值设置为”(and with values set to ‘) crisp
的值.(’ values.)
第二,(In the second, the) Value
除了”(fields are not used, except for “) MARRIED
“,而是为数字输入传递间隔,并为(”, and instead intervals are passed for the numeric inputs and fuzzy categories for the) Blind
输入,因此证明了推理引擎在存在不确定性的情况下进行推理的能力.(input, so demonstrating inference engine’s ability to infer in the presence of uncertainty.)
最后,在第三部分中,(And finally, in the third section, a couple of the) DarlVars
设置为未知状态(在一种情况下是明确指定),而在另一种情况下,则不设置(are set to the unknown state, in one case explicitly, in another by giving no) Value
,推理引擎将展示如何处理丢失的数据.(, and the inference engine shows how it handles missing data.)
生成的结果如下所示:(The results generated are as shown below:)
Simple crisp example
name = TOTAL_ALLOWANCES, datatype = numeric Central value: 8105,
isUnknown = False, confidence = 1
name = TOTAL_INCOME, datatype = numeric Central value: 32933.33316,
isUnknown = False, confidence = 1
name = EARNED_TAX, datatype = numeric Central value: 1499, isUnknown = False, confidence = 1
name = DIVIDEND_TAX, datatype = numeric Central value: 0, isUnknown = False, confidence = 1
name = TOTAL_TAX, datatype = numeric Central value: 1499, isUnknown = False, confidence = 1
name = TOTAL_TAX_MONTHLY, datatype = numeric Central value: 124.916666666667,
isUnknown = False, confidence = 1
name = NI, datatype = numeric Central value: 960.96, isUnknown = False, confidence = 1
name = NI_MONTHLY, datatype = numeric Central value: 80.08, isUnknown = False, confidence = 1
name = EARNED_INCOME_AFTER_ALLOWANCES, datatype = numeric Central value: 7495,
isUnknown = False, confidence = 1
name = TOTAL_INCOME_AFTER_ALLOWANCES, datatype = numeric Central value: 24828.33316,
isUnknown = False, confidence = 1
name = TOTAL_YEARLY_TAKE_HOME, datatype = numeric Central value: 30661.96,
isUnknown = False, confidence = 1
name = TOTAL_MONTHLY_TAKE_HOME, datatype = numeric Central value: 2555.16333333333,
isUnknown = False, confidence = 1
name = YEARLY_EMPLOYERS_NI, datatype = numeric Central value: 1119.456,
isUnknown = False, confidence = 1
name = TAX_TAKE_PERCENT, datatype = numeric Central value: 7.68940243836403,
isUnknown = False, confidence = 1
Fuzzy Interval example
name = TOTAL_ALLOWANCES, datatype = numeric Central value: 9155,
isUnknown = False, confidence = 1 Fuzzy numeric values = 8105,10205
name = TOTAL_INCOME, datatype = numeric Central value: 35555.55535,
isUnknown = False, confidence = 1 Fuzzy numeric values = 31999.9998,39111.1109
name = EARNED_TAX, datatype = numeric Central value: 1169, isUnknown = False,
confidence = 1 Fuzzy numeric values = 359,1979
name = DIVIDEND_TAX, datatype = numeric Central value: 0, isUnknown = False, confidence = 1
name = TOTAL_TAX, datatype = numeric Central value: 1169, isUnknown = False,
confidence = 1 Fuzzy numeric values = 359,1979
name = TOTAL_TAX_MONTHLY, datatype = numeric Central value: 97.4166666666666,
isUnknown = False, confidence = 1 Fuzzy numeric values = 29.9166666666667,164.916666666667
name = NI, datatype = numeric Central value: 888.96, isUnknown = False,
confidence = 1 Fuzzy numeric values = 528.96,1248.96
name = NI_MONTHLY, datatype = numeric Central value: 74.08, isUnknown = False,
confidence = 1 Fuzzy numeric values = 44.08,104.08
name = EARNED_INCOME_AFTER_ALLOWANCES, datatype = numeric Central value: 5845,
isUnknown = False, confidence = 1 Fuzzy numeric values = 1795,9895
name = TOTAL_INCOME_AFTER_ALLOWANCES, datatype = numeric Central value: 26400.55535,
isUnknown = False, confidence = 1 Fuzzy numeric values = 21794.9998,31006.1109
name = TOTAL_YEARLY_TAKE_HOME, datatype = numeric Central value: 33219.96,
isUnknown = False, confidence = 1 Fuzzy numeric values = 28549.96,37889.96
name = TOTAL_MONTHLY_TAKE_HOME, datatype = numeric Central value: 2768.33,
isUnknown = False, confidence = 1 Fuzzy numeric values = 2379.16333333333,3157.49666666667
name = YEARLY_EMPLOYERS_NI, datatype = numeric Central value: 1036.656,
isUnknown = False, confidence = 1 Fuzzy numeric values = 622.656,1450.656
name = TAX_TAKE_PERCENT, datatype = numeric Central value: 6.46663096745925,
isUnknown = False, confidence = 1 Fuzzy numeric values = 2.42015098213091,10.5131109527876
Unknown handling example
name = TOTAL_ALLOWANCES, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = TOTAL_INCOME, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = EARNED_TAX, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = DIVIDEND_TAX, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = TOTAL_TAX, datatype = numeric Central value: , isUnknown = True, confidence = 0
name = TOTAL_TAX_MONTHLY, datatype = numeric Central value: , isUnknown = True, confidence = 0
name = NI, datatype = numeric Central value: , isUnknown = True, confidence = 0
name = NI_MONTHLY, datatype = numeric Central value: , isUnknown = True, confidence = 0
name = EARNED_INCOME_AFTER_ALLOWANCES, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = TOTAL_INCOME_AFTER_ALLOWANCES, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = TOTAL_YEARLY_TAKE_HOME, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = TOTAL_MONTHLY_TAKE_HOME, datatype = numeric Central value: ,
isUnknown = True, confidence = 0
name = YEARLY_EMPLOYERS_NI, datatype = numeric Central value: , isUnknown = True, confidence = 0
name = TAX_TAKE_PERCENT, datatype = numeric Central value: , isUnknown = True, confidence = 0
加起来(Summing Up)
在我们万事俱备的新时代中,基于AI规则的系统已被遗忘,但它们具有巨大的潜力.(In our new rush to all things, AI rule based systems have been forgotten, but they have huge potential.)
有关更多信息,请参见(For more information, look at the) darl.ai(darl.ai) 现场.免费试用版允许您访问使用DARL的Bot系统,但是也有多个示例规则集,涵盖了Lawtech示例的性格测试.您还可以在实际中看到针对DARL的机器学习.(site. The free trial gives you access to a Bot system making use of DARL, but there are also multiple example rulesets covering personality tests to Lawtech examples. You can also see machine learning to DARL in action.)
历史(History)
- 04/15/2018:第一版(04/15/2018: First version)
许可
本文以及所有相关的源代码和文件均已获得The Code Project Open License (CPOL)的许可。
C# .NET REST CORE AI 新闻 翻译