我正在尝试使用 HPCC ML_Core 和 LearningTree 库对一些数据进行分类。数据都是数字,因变量是无符号整数。无论我做什么,我都会收到相同的错误“对象'类型'没有名为't_Work_Item'的成员”
错误的位置甚至不在我的文件中。它位于名为 RF_Base.ecl 的文件中。
我不知道如何解决这个错误。
我使用本教程来设置我的代码:https ://hpccsystems.com/blog/HPCC-Sytems-Machine-Learning 。
这些是我收到的错误消息:
图片链接:https ://i.imgur.com/4WxElRJ.jpg
我已将我正在处理的文件移动到与我安装的捆绑包相同的文件中,以查看将我的文件放在与库相同的位置是否会有所帮助,但它没有。
错误发生在第 62 行: myLearnerC := LT.ClassificationForest();
IMPORT ML_Core, std;
IMPORT ML_Core.Discretize;
IMPORT LearningTrees AS LT;
articles_layout := RECORD
INTEGER articleID;
UNSIGNED INTEGER sectionName; //dependent variable I'm trying to classify
INTEGER newsDesk; //newsDesk to key9 are independent variables I'm using to classify the section name
INTEGER key1;
INTEGER key2;
INTEGER key3;
INTEGER key4;
INTEGER key5;
INTEGER key6;
INTEGER key7;
INTEGER key8;
INTEGER key9; //not all key attributes have data, some are empty
END;
all_articles := DATASET('~online::hjj::parsed_articles_reordered', articles_layout, CSV) : PERSIST('online::hjj::all_articles');
//all_articles[1..40];
known_articles := all_articles(sectionName != 25);
//known_articles[1..40];
unknown_articles := all_articles(sectionName = 25) : PERSIST('online::hjj::unknown_articles');
//unknown_articles[1..40];
articles_layout_ext := RECORD(articles_layout)
UNSIGNED4 RND;
END;
articles_ext := PROJECT(known_articles, TRANSFORM(articles_layout_ext, SELF.rnd := RANDOM(), SELF := LEFT));
articles_shuffled := SORT(articles_ext, rnd);
training_articles := PROJECT(articles_shuffled[1..2330], articles_layout) : PERSIST('online:hjj::training_articles');
//training_articles[1..30];
testing_articles := PROJECT(articles_shuffled[2331..2923], articles_layout) : PERSIST('online:hjj::testing_articles');
//testing_articles[1..30];
ML_Core.ToField(training_articles, training_articles_NF);
training_articles_NF[1..50];
ML_Core.ToField(testing_articles, testing_articles_NF);
testing_articles_NF[1..50];
myIndTrainDataNF := training_articles_NF(number > 1);
myDepTrainDataNF := PROJECT(training_articles_NF(number = 1), TRANSFORM(RECORDOF(LEFT), SELF.number := 1, SELF := LEFT));
myIndTestDataNF := training_articles_NF(number > 1);
myDepTestDataNF := PROJECT(testing_articles_NF(number = 1), TRANSFORM(RECORDOF(LEFT), SELF.number := 1, SELF := LEFT));
myDepTrainDataDF := Discretize.ByRounding(myDepTrainDataNF);
myDepTestDataDF := Discretize.ByRounding(myDepTestDataNF);
//PROBLEM STATEMENT HERE
myLearnerC := LT.ClassificationForest();
myModelC := myLearnerC.GetModel(myIndTrainDataNF, myDepTrainDataDF);
predictedClasses := myLearnerC.Classify(myModelC, myIndTestDataNF) : PERSIST('online::hjj::predicted_classes');
assessmentC := ML_Core.Analysis.Classification.Accuracy(predictedClasses, myDepTestDataDF) : PERSIST('online::hjj::assessment');
错误在 RF_Base.ecl 文件的第 14 行
IMPORT $.^ AS LT;
IMPORT LT.Internal AS int;
IMPORT LT.LT_Types as Types;
IMPORT ML_Core as ML;
IMPORT ML.Types AS CTypes;
IMPORT std.system.Thorlib;
IMPORT ML_Core.ModelOps2;
GenField := Types.GenField;
ModelStats := Types.ModelStats;
//ERROR HERE
t_Work_Item := CTypes.t_Work_Item;
t_Count := CTypes.t_Count;
t_RecordId := CTypes.t_RecordID;
t_FieldNumber := CTypes.t_FieldNumber;
t_TreeId := t_FieldNumber;
Layout_Model := CTypes.Layout_Model;
wiInfo := Types.wiInfo;
TreeNodeDat := Types.TreeNodeDat;
NumericField := CTypes.NumericField;
DiscreteField := CTypes.DiscreteField;
Layout_Model2 := CTypes.Layout_Model2;
FeatureImportanceRec := Types.FeatureImportanceRec;
nfNull := DATASET([], NumericField);
真的不确定如何解决这个问题。提前致谢。