googleprediction.pp 64 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192
  1. unit googleprediction;
  2. {
  3. **********************************************************************
  4. This file is part of the Free Component Library (FCL)
  5. Copyright (c) 2015 The free pascal team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************
  12. }
  13. //Generated on: 16-5-15 08:53:06
  14. {$MODE objfpc}
  15. {$H+}
  16. interface
  17. uses sysutils, classes, googleservice, restbase, googlebase;
  18. type
  19. //Top-level schema types
  20. TAnalyze = Class;
  21. TInput = Class;
  22. TInsert = Class;
  23. TInsert2 = Class;
  24. TList = Class;
  25. TOutput = Class;
  26. TUpdate = Class;
  27. TAnalyzeArray = Array of TAnalyze;
  28. TInputArray = Array of TInput;
  29. TInsertArray = Array of TInsert;
  30. TInsert2Array = Array of TInsert2;
  31. TListArray = Array of TList;
  32. TOutputArray = Array of TOutput;
  33. TUpdateArray = Array of TUpdate;
  34. //Anonymous types, using auto-generated names
  35. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem = Class;
  36. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical = Class;
  37. TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric = Class;
  38. TAnalyzeTypedataDescriptionTypefeaturesItemTypetext = Class;
  39. TAnalyzeTypedataDescriptionTypefeaturesItem = Class;
  40. TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric = Class;
  41. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem = Class;
  42. TAnalyzeTypedataDescriptionTypeoutputFeature = Class;
  43. TAnalyzeTypedataDescription = Class;
  44. TAnalyzeTypeerrorsItem = Class;
  45. TAnalyzeTypemodelDescriptionTypeconfusionMatrix = Class;
  46. TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals = Class;
  47. TAnalyzeTypemodelDescription = Class;
  48. TInputTypeinput = Class;
  49. TInsertTypetrainingInstancesItem = Class;
  50. TInsertTypeutilityItem = Class;
  51. TInsert2TypemodelInfo = Class;
  52. TOutputTypeoutputMultiItem = Class;
  53. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesArray = Array of TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem;
  54. TAnalyzeTypedataDescriptionTypefeaturesArray = Array of TAnalyzeTypedataDescriptionTypefeaturesItem;
  55. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextArray = Array of TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem;
  56. TAnalyzeTypeerrorsArray = Array of TAnalyzeTypeerrorsItem;
  57. TInsertTypetrainingInstancesArray = Array of TInsertTypetrainingInstancesItem;
  58. TInsertTypeutilityArray = Array of TInsertTypeutilityItem;
  59. TListTypeitemsArray = Array of TInsert2;
  60. TOutputTypeoutputMultiArray = Array of TOutputTypeoutputMultiItem;
  61. { --------------------------------------------------------------------
  62. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem
  63. --------------------------------------------------------------------}
  64. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem = Class(TGoogleBaseObject)
  65. Private
  66. Fcount : String;
  67. Fvalue : String;
  68. Protected
  69. //Property setters
  70. Procedure Setcount(AIndex : Integer; AValue : String); virtual;
  71. Procedure Setvalue(AIndex : Integer; AValue : String); virtual;
  72. Public
  73. Published
  74. Property count : String Index 0 Read Fcount Write Setcount;
  75. Property value : String Index 8 Read Fvalue Write Setvalue;
  76. end;
  77. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItemClass = Class of TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem;
  78. { --------------------------------------------------------------------
  79. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical
  80. --------------------------------------------------------------------}
  81. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical = Class(TGoogleBaseObject)
  82. Private
  83. Fcount : String;
  84. Fvalues : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesArray;
  85. Protected
  86. //Property setters
  87. Procedure Setcount(AIndex : Integer; AValue : String); virtual;
  88. Procedure Setvalues(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesArray); virtual;
  89. //2.6.4. bug workaround
  90. {$IFDEF VER2_6}
  91. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  92. {$ENDIF VER2_6}
  93. Public
  94. Published
  95. Property count : String Index 0 Read Fcount Write Setcount;
  96. Property values : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesArray Index 8 Read Fvalues Write Setvalues;
  97. end;
  98. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalClass = Class of TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical;
  99. { --------------------------------------------------------------------
  100. TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric
  101. --------------------------------------------------------------------}
  102. TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric = Class(TGoogleBaseObject)
  103. Private
  104. Fcount : String;
  105. Fmean : String;
  106. Fvariance : String;
  107. Protected
  108. //Property setters
  109. Procedure Setcount(AIndex : Integer; AValue : String); virtual;
  110. Procedure Setmean(AIndex : Integer; AValue : String); virtual;
  111. Procedure Setvariance(AIndex : Integer; AValue : String); virtual;
  112. Public
  113. Published
  114. Property count : String Index 0 Read Fcount Write Setcount;
  115. Property mean : String Index 8 Read Fmean Write Setmean;
  116. Property variance : String Index 16 Read Fvariance Write Setvariance;
  117. end;
  118. TAnalyzeTypedataDescriptionTypefeaturesItemTypenumericClass = Class of TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric;
  119. { --------------------------------------------------------------------
  120. TAnalyzeTypedataDescriptionTypefeaturesItemTypetext
  121. --------------------------------------------------------------------}
  122. TAnalyzeTypedataDescriptionTypefeaturesItemTypetext = Class(TGoogleBaseObject)
  123. Private
  124. Fcount : String;
  125. Protected
  126. //Property setters
  127. Procedure Setcount(AIndex : Integer; AValue : String); virtual;
  128. Public
  129. Published
  130. Property count : String Index 0 Read Fcount Write Setcount;
  131. end;
  132. TAnalyzeTypedataDescriptionTypefeaturesItemTypetextClass = Class of TAnalyzeTypedataDescriptionTypefeaturesItemTypetext;
  133. { --------------------------------------------------------------------
  134. TAnalyzeTypedataDescriptionTypefeaturesItem
  135. --------------------------------------------------------------------}
  136. TAnalyzeTypedataDescriptionTypefeaturesItem = Class(TGoogleBaseObject)
  137. Private
  138. Fcategorical : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical;
  139. Findex : String;
  140. Fnumeric : TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric;
  141. Ftext : TAnalyzeTypedataDescriptionTypefeaturesItemTypetext;
  142. Protected
  143. //Property setters
  144. Procedure Setcategorical(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical); virtual;
  145. Procedure Setindex(AIndex : Integer; AValue : String); virtual;
  146. Procedure Setnumeric(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric); virtual;
  147. Procedure Settext(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypetext); virtual;
  148. Public
  149. Published
  150. Property categorical : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical Index 0 Read Fcategorical Write Setcategorical;
  151. Property index : String Index 8 Read Findex Write Setindex;
  152. Property numeric : TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric Index 16 Read Fnumeric Write Setnumeric;
  153. Property text : TAnalyzeTypedataDescriptionTypefeaturesItemTypetext Index 24 Read Ftext Write Settext;
  154. end;
  155. TAnalyzeTypedataDescriptionTypefeaturesItemClass = Class of TAnalyzeTypedataDescriptionTypefeaturesItem;
  156. { --------------------------------------------------------------------
  157. TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric
  158. --------------------------------------------------------------------}
  159. TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric = Class(TGoogleBaseObject)
  160. Private
  161. Fcount : String;
  162. Fmean : String;
  163. Fvariance : String;
  164. Protected
  165. //Property setters
  166. Procedure Setcount(AIndex : Integer; AValue : String); virtual;
  167. Procedure Setmean(AIndex : Integer; AValue : String); virtual;
  168. Procedure Setvariance(AIndex : Integer; AValue : String); virtual;
  169. Public
  170. Published
  171. Property count : String Index 0 Read Fcount Write Setcount;
  172. Property mean : String Index 8 Read Fmean Write Setmean;
  173. Property variance : String Index 16 Read Fvariance Write Setvariance;
  174. end;
  175. TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumericClass = Class of TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric;
  176. { --------------------------------------------------------------------
  177. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem
  178. --------------------------------------------------------------------}
  179. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem = Class(TGoogleBaseObject)
  180. Private
  181. Fcount : String;
  182. Fvalue : String;
  183. Protected
  184. //Property setters
  185. Procedure Setcount(AIndex : Integer; AValue : String); virtual;
  186. Procedure Setvalue(AIndex : Integer; AValue : String); virtual;
  187. Public
  188. Published
  189. Property count : String Index 0 Read Fcount Write Setcount;
  190. Property value : String Index 8 Read Fvalue Write Setvalue;
  191. end;
  192. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItemClass = Class of TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem;
  193. { --------------------------------------------------------------------
  194. TAnalyzeTypedataDescriptionTypeoutputFeature
  195. --------------------------------------------------------------------}
  196. TAnalyzeTypedataDescriptionTypeoutputFeature = Class(TGoogleBaseObject)
  197. Private
  198. Fnumeric : TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric;
  199. Ftext : TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextArray;
  200. Protected
  201. //Property setters
  202. Procedure Setnumeric(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric); virtual;
  203. Procedure Settext(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextArray); virtual;
  204. //2.6.4. bug workaround
  205. {$IFDEF VER2_6}
  206. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  207. {$ENDIF VER2_6}
  208. Public
  209. Published
  210. Property numeric : TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric Index 0 Read Fnumeric Write Setnumeric;
  211. Property text : TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextArray Index 8 Read Ftext Write Settext;
  212. end;
  213. TAnalyzeTypedataDescriptionTypeoutputFeatureClass = Class of TAnalyzeTypedataDescriptionTypeoutputFeature;
  214. { --------------------------------------------------------------------
  215. TAnalyzeTypedataDescription
  216. --------------------------------------------------------------------}
  217. TAnalyzeTypedataDescription = Class(TGoogleBaseObject)
  218. Private
  219. Ffeatures : TAnalyzeTypedataDescriptionTypefeaturesArray;
  220. FoutputFeature : TAnalyzeTypedataDescriptionTypeoutputFeature;
  221. Protected
  222. //Property setters
  223. Procedure Setfeatures(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesArray); virtual;
  224. Procedure SetoutputFeature(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypeoutputFeature); virtual;
  225. //2.6.4. bug workaround
  226. {$IFDEF VER2_6}
  227. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  228. {$ENDIF VER2_6}
  229. Public
  230. Published
  231. Property features : TAnalyzeTypedataDescriptionTypefeaturesArray Index 0 Read Ffeatures Write Setfeatures;
  232. Property outputFeature : TAnalyzeTypedataDescriptionTypeoutputFeature Index 8 Read FoutputFeature Write SetoutputFeature;
  233. end;
  234. TAnalyzeTypedataDescriptionClass = Class of TAnalyzeTypedataDescription;
  235. { --------------------------------------------------------------------
  236. TAnalyzeTypeerrorsItem
  237. --------------------------------------------------------------------}
  238. TAnalyzeTypeerrorsItem = Class(TGoogleBaseObject)
  239. Private
  240. Protected
  241. //Property setters
  242. Public
  243. Class Function AllowAdditionalProperties : Boolean; override;
  244. Published
  245. end;
  246. TAnalyzeTypeerrorsItemClass = Class of TAnalyzeTypeerrorsItem;
  247. { --------------------------------------------------------------------
  248. TAnalyzeTypemodelDescriptionTypeconfusionMatrix
  249. --------------------------------------------------------------------}
  250. TAnalyzeTypemodelDescriptionTypeconfusionMatrix = Class(TGoogleBaseObject)
  251. Private
  252. Protected
  253. //Property setters
  254. Public
  255. Class Function AllowAdditionalProperties : Boolean; override;
  256. Published
  257. end;
  258. TAnalyzeTypemodelDescriptionTypeconfusionMatrixClass = Class of TAnalyzeTypemodelDescriptionTypeconfusionMatrix;
  259. { --------------------------------------------------------------------
  260. TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals
  261. --------------------------------------------------------------------}
  262. TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals = Class(TGoogleBaseObject)
  263. Private
  264. Protected
  265. //Property setters
  266. Public
  267. Class Function AllowAdditionalProperties : Boolean; override;
  268. Published
  269. end;
  270. TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotalsClass = Class of TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals;
  271. { --------------------------------------------------------------------
  272. TAnalyzeTypemodelDescription
  273. --------------------------------------------------------------------}
  274. TAnalyzeTypemodelDescription = Class(TGoogleBaseObject)
  275. Private
  276. FconfusionMatrix : TAnalyzeTypemodelDescriptionTypeconfusionMatrix;
  277. FconfusionMatrixRowTotals : TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals;
  278. Fmodelinfo : TInsert2;
  279. Protected
  280. //Property setters
  281. Procedure SetconfusionMatrix(AIndex : Integer; AValue : TAnalyzeTypemodelDescriptionTypeconfusionMatrix); virtual;
  282. Procedure SetconfusionMatrixRowTotals(AIndex : Integer; AValue : TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals); virtual;
  283. Procedure Setmodelinfo(AIndex : Integer; AValue : TInsert2); virtual;
  284. Public
  285. Published
  286. Property confusionMatrix : TAnalyzeTypemodelDescriptionTypeconfusionMatrix Index 0 Read FconfusionMatrix Write SetconfusionMatrix;
  287. Property confusionMatrixRowTotals : TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals Index 8 Read FconfusionMatrixRowTotals Write SetconfusionMatrixRowTotals;
  288. Property modelinfo : TInsert2 Index 16 Read Fmodelinfo Write Setmodelinfo;
  289. end;
  290. TAnalyzeTypemodelDescriptionClass = Class of TAnalyzeTypemodelDescription;
  291. { --------------------------------------------------------------------
  292. TAnalyze
  293. --------------------------------------------------------------------}
  294. TAnalyze = Class(TGoogleBaseObject)
  295. Private
  296. FdataDescription : TAnalyzeTypedataDescription;
  297. Ferrors : TAnalyzeTypeerrorsArray;
  298. Fid : String;
  299. Fkind : String;
  300. FmodelDescription : TAnalyzeTypemodelDescription;
  301. FselfLink : String;
  302. Protected
  303. //Property setters
  304. Procedure SetdataDescription(AIndex : Integer; AValue : TAnalyzeTypedataDescription); virtual;
  305. Procedure Seterrors(AIndex : Integer; AValue : TAnalyzeTypeerrorsArray); virtual;
  306. Procedure Setid(AIndex : Integer; AValue : String); virtual;
  307. Procedure Setkind(AIndex : Integer; AValue : String); virtual;
  308. Procedure SetmodelDescription(AIndex : Integer; AValue : TAnalyzeTypemodelDescription); virtual;
  309. Procedure SetselfLink(AIndex : Integer; AValue : String); virtual;
  310. //2.6.4. bug workaround
  311. {$IFDEF VER2_6}
  312. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  313. {$ENDIF VER2_6}
  314. Public
  315. Published
  316. Property dataDescription : TAnalyzeTypedataDescription Index 0 Read FdataDescription Write SetdataDescription;
  317. Property errors : TAnalyzeTypeerrorsArray Index 8 Read Ferrors Write Seterrors;
  318. Property id : String Index 16 Read Fid Write Setid;
  319. Property kind : String Index 24 Read Fkind Write Setkind;
  320. Property modelDescription : TAnalyzeTypemodelDescription Index 32 Read FmodelDescription Write SetmodelDescription;
  321. Property selfLink : String Index 40 Read FselfLink Write SetselfLink;
  322. end;
  323. TAnalyzeClass = Class of TAnalyze;
  324. { --------------------------------------------------------------------
  325. TInputTypeinput
  326. --------------------------------------------------------------------}
  327. TInputTypeinput = Class(TGoogleBaseObject)
  328. Private
  329. FcsvInstance : TTJSONSchemaArray;
  330. Protected
  331. //Property setters
  332. Procedure SetcsvInstance(AIndex : Integer; AValue : TTJSONSchemaArray); virtual;
  333. //2.6.4. bug workaround
  334. {$IFDEF VER2_6}
  335. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  336. {$ENDIF VER2_6}
  337. Public
  338. Published
  339. Property csvInstance : TTJSONSchemaArray Index 0 Read FcsvInstance Write SetcsvInstance;
  340. end;
  341. TInputTypeinputClass = Class of TInputTypeinput;
  342. { --------------------------------------------------------------------
  343. TInput
  344. --------------------------------------------------------------------}
  345. TInput = Class(TGoogleBaseObject)
  346. Private
  347. Finput : TInputTypeinput;
  348. Protected
  349. //Property setters
  350. Procedure Setinput(AIndex : Integer; AValue : TInputTypeinput); virtual;
  351. Public
  352. Published
  353. Property input : TInputTypeinput Index 0 Read Finput Write Setinput;
  354. end;
  355. TInputClass = Class of TInput;
  356. { --------------------------------------------------------------------
  357. TInsertTypetrainingInstancesItem
  358. --------------------------------------------------------------------}
  359. TInsertTypetrainingInstancesItem = Class(TGoogleBaseObject)
  360. Private
  361. FcsvInstance : TTJSONSchemaArray;
  362. Foutput : String;
  363. Protected
  364. //Property setters
  365. Procedure SetcsvInstance(AIndex : Integer; AValue : TTJSONSchemaArray); virtual;
  366. Procedure Setoutput(AIndex : Integer; AValue : String); virtual;
  367. //2.6.4. bug workaround
  368. {$IFDEF VER2_6}
  369. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  370. {$ENDIF VER2_6}
  371. Public
  372. Published
  373. Property csvInstance : TTJSONSchemaArray Index 0 Read FcsvInstance Write SetcsvInstance;
  374. Property output : String Index 8 Read Foutput Write Setoutput;
  375. end;
  376. TInsertTypetrainingInstancesItemClass = Class of TInsertTypetrainingInstancesItem;
  377. { --------------------------------------------------------------------
  378. TInsertTypeutilityItem
  379. --------------------------------------------------------------------}
  380. TInsertTypeutilityItem = Class(TGoogleBaseObject)
  381. Private
  382. Protected
  383. //Property setters
  384. Public
  385. Class Function AllowAdditionalProperties : Boolean; override;
  386. Published
  387. end;
  388. TInsertTypeutilityItemClass = Class of TInsertTypeutilityItem;
  389. { --------------------------------------------------------------------
  390. TInsert
  391. --------------------------------------------------------------------}
  392. TInsert = Class(TGoogleBaseObject)
  393. Private
  394. Fid : String;
  395. FmodelType : String;
  396. FsourceModel : String;
  397. FstorageDataLocation : String;
  398. FstoragePMMLLocation : String;
  399. FstoragePMMLModelLocation : String;
  400. FtrainingInstances : TInsertTypetrainingInstancesArray;
  401. Futility : TInsertTypeutilityArray;
  402. Protected
  403. //Property setters
  404. Procedure Setid(AIndex : Integer; AValue : String); virtual;
  405. Procedure SetmodelType(AIndex : Integer; AValue : String); virtual;
  406. Procedure SetsourceModel(AIndex : Integer; AValue : String); virtual;
  407. Procedure SetstorageDataLocation(AIndex : Integer; AValue : String); virtual;
  408. Procedure SetstoragePMMLLocation(AIndex : Integer; AValue : String); virtual;
  409. Procedure SetstoragePMMLModelLocation(AIndex : Integer; AValue : String); virtual;
  410. Procedure SettrainingInstances(AIndex : Integer; AValue : TInsertTypetrainingInstancesArray); virtual;
  411. Procedure Setutility(AIndex : Integer; AValue : TInsertTypeutilityArray); virtual;
  412. //2.6.4. bug workaround
  413. {$IFDEF VER2_6}
  414. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  415. {$ENDIF VER2_6}
  416. Public
  417. Published
  418. Property id : String Index 0 Read Fid Write Setid;
  419. Property modelType : String Index 8 Read FmodelType Write SetmodelType;
  420. Property sourceModel : String Index 16 Read FsourceModel Write SetsourceModel;
  421. Property storageDataLocation : String Index 24 Read FstorageDataLocation Write SetstorageDataLocation;
  422. Property storagePMMLLocation : String Index 32 Read FstoragePMMLLocation Write SetstoragePMMLLocation;
  423. Property storagePMMLModelLocation : String Index 40 Read FstoragePMMLModelLocation Write SetstoragePMMLModelLocation;
  424. Property trainingInstances : TInsertTypetrainingInstancesArray Index 48 Read FtrainingInstances Write SettrainingInstances;
  425. Property utility : TInsertTypeutilityArray Index 56 Read Futility Write Setutility;
  426. end;
  427. TInsertClass = Class of TInsert;
  428. { --------------------------------------------------------------------
  429. TInsert2TypemodelInfo
  430. --------------------------------------------------------------------}
  431. TInsert2TypemodelInfo = Class(TGoogleBaseObject)
  432. Private
  433. FclassWeightedAccuracy : String;
  434. FclassificationAccuracy : String;
  435. FmeanSquaredError : String;
  436. FmodelType : String;
  437. FnumberInstances : String;
  438. FnumberLabels : String;
  439. Protected
  440. //Property setters
  441. Procedure SetclassWeightedAccuracy(AIndex : Integer; AValue : String); virtual;
  442. Procedure SetclassificationAccuracy(AIndex : Integer; AValue : String); virtual;
  443. Procedure SetmeanSquaredError(AIndex : Integer; AValue : String); virtual;
  444. Procedure SetmodelType(AIndex : Integer; AValue : String); virtual;
  445. Procedure SetnumberInstances(AIndex : Integer; AValue : String); virtual;
  446. Procedure SetnumberLabels(AIndex : Integer; AValue : String); virtual;
  447. Public
  448. Published
  449. Property classWeightedAccuracy : String Index 0 Read FclassWeightedAccuracy Write SetclassWeightedAccuracy;
  450. Property classificationAccuracy : String Index 8 Read FclassificationAccuracy Write SetclassificationAccuracy;
  451. Property meanSquaredError : String Index 16 Read FmeanSquaredError Write SetmeanSquaredError;
  452. Property modelType : String Index 24 Read FmodelType Write SetmodelType;
  453. Property numberInstances : String Index 32 Read FnumberInstances Write SetnumberInstances;
  454. Property numberLabels : String Index 40 Read FnumberLabels Write SetnumberLabels;
  455. end;
  456. TInsert2TypemodelInfoClass = Class of TInsert2TypemodelInfo;
  457. { --------------------------------------------------------------------
  458. TInsert2
  459. --------------------------------------------------------------------}
  460. TInsert2 = Class(TGoogleBaseObject)
  461. Private
  462. Fcreated : TDatetime;
  463. Fid : String;
  464. Fkind : String;
  465. FmodelInfo : TInsert2TypemodelInfo;
  466. FmodelType : String;
  467. FselfLink : String;
  468. FstorageDataLocation : String;
  469. FstoragePMMLLocation : String;
  470. FstoragePMMLModelLocation : String;
  471. FtrainingComplete : TDatetime;
  472. FtrainingStatus : String;
  473. Protected
  474. //Property setters
  475. Procedure Setcreated(AIndex : Integer; AValue : TDatetime); virtual;
  476. Procedure Setid(AIndex : Integer; AValue : String); virtual;
  477. Procedure Setkind(AIndex : Integer; AValue : String); virtual;
  478. Procedure SetmodelInfo(AIndex : Integer; AValue : TInsert2TypemodelInfo); virtual;
  479. Procedure SetmodelType(AIndex : Integer; AValue : String); virtual;
  480. Procedure SetselfLink(AIndex : Integer; AValue : String); virtual;
  481. Procedure SetstorageDataLocation(AIndex : Integer; AValue : String); virtual;
  482. Procedure SetstoragePMMLLocation(AIndex : Integer; AValue : String); virtual;
  483. Procedure SetstoragePMMLModelLocation(AIndex : Integer; AValue : String); virtual;
  484. Procedure SettrainingComplete(AIndex : Integer; AValue : TDatetime); virtual;
  485. Procedure SettrainingStatus(AIndex : Integer; AValue : String); virtual;
  486. Public
  487. Published
  488. Property created : TDatetime Index 0 Read Fcreated Write Setcreated;
  489. Property id : String Index 8 Read Fid Write Setid;
  490. Property kind : String Index 16 Read Fkind Write Setkind;
  491. Property modelInfo : TInsert2TypemodelInfo Index 24 Read FmodelInfo Write SetmodelInfo;
  492. Property modelType : String Index 32 Read FmodelType Write SetmodelType;
  493. Property selfLink : String Index 40 Read FselfLink Write SetselfLink;
  494. Property storageDataLocation : String Index 48 Read FstorageDataLocation Write SetstorageDataLocation;
  495. Property storagePMMLLocation : String Index 56 Read FstoragePMMLLocation Write SetstoragePMMLLocation;
  496. Property storagePMMLModelLocation : String Index 64 Read FstoragePMMLModelLocation Write SetstoragePMMLModelLocation;
  497. Property trainingComplete : TDatetime Index 72 Read FtrainingComplete Write SettrainingComplete;
  498. Property trainingStatus : String Index 80 Read FtrainingStatus Write SettrainingStatus;
  499. end;
  500. TInsert2Class = Class of TInsert2;
  501. { --------------------------------------------------------------------
  502. TList
  503. --------------------------------------------------------------------}
  504. TList = Class(TGoogleBaseObject)
  505. Private
  506. Fitems : TListTypeitemsArray;
  507. Fkind : String;
  508. FnextPageToken : String;
  509. FselfLink : String;
  510. Protected
  511. //Property setters
  512. Procedure Setitems(AIndex : Integer; AValue : TListTypeitemsArray); virtual;
  513. Procedure Setkind(AIndex : Integer; AValue : String); virtual;
  514. Procedure SetnextPageToken(AIndex : Integer; AValue : String); virtual;
  515. Procedure SetselfLink(AIndex : Integer; AValue : String); virtual;
  516. //2.6.4. bug workaround
  517. {$IFDEF VER2_6}
  518. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  519. {$ENDIF VER2_6}
  520. Public
  521. Published
  522. Property items : TListTypeitemsArray Index 0 Read Fitems Write Setitems;
  523. Property kind : String Index 8 Read Fkind Write Setkind;
  524. Property nextPageToken : String Index 16 Read FnextPageToken Write SetnextPageToken;
  525. Property selfLink : String Index 24 Read FselfLink Write SetselfLink;
  526. end;
  527. TListClass = Class of TList;
  528. { --------------------------------------------------------------------
  529. TOutputTypeoutputMultiItem
  530. --------------------------------------------------------------------}
  531. TOutputTypeoutputMultiItem = Class(TGoogleBaseObject)
  532. Private
  533. F_label : String;
  534. Fscore : String;
  535. Protected
  536. Class Function ExportPropertyName(Const AName : String) : string; override;
  537. //Property setters
  538. Procedure Set_label(AIndex : Integer; AValue : String); virtual;
  539. Procedure Setscore(AIndex : Integer; AValue : String); virtual;
  540. Public
  541. Published
  542. Property _label : String Index 0 Read F_label Write Set_label;
  543. Property score : String Index 8 Read Fscore Write Setscore;
  544. end;
  545. TOutputTypeoutputMultiItemClass = Class of TOutputTypeoutputMultiItem;
  546. { --------------------------------------------------------------------
  547. TOutput
  548. --------------------------------------------------------------------}
  549. TOutput = Class(TGoogleBaseObject)
  550. Private
  551. Fid : String;
  552. Fkind : String;
  553. FoutputLabel : String;
  554. FoutputMulti : TOutputTypeoutputMultiArray;
  555. FoutputValue : String;
  556. FselfLink : String;
  557. Protected
  558. //Property setters
  559. Procedure Setid(AIndex : Integer; AValue : String); virtual;
  560. Procedure Setkind(AIndex : Integer; AValue : String); virtual;
  561. Procedure SetoutputLabel(AIndex : Integer; AValue : String); virtual;
  562. Procedure SetoutputMulti(AIndex : Integer; AValue : TOutputTypeoutputMultiArray); virtual;
  563. Procedure SetoutputValue(AIndex : Integer; AValue : String); virtual;
  564. Procedure SetselfLink(AIndex : Integer; AValue : String); virtual;
  565. //2.6.4. bug workaround
  566. {$IFDEF VER2_6}
  567. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  568. {$ENDIF VER2_6}
  569. Public
  570. Published
  571. Property id : String Index 0 Read Fid Write Setid;
  572. Property kind : String Index 8 Read Fkind Write Setkind;
  573. Property outputLabel : String Index 16 Read FoutputLabel Write SetoutputLabel;
  574. Property outputMulti : TOutputTypeoutputMultiArray Index 24 Read FoutputMulti Write SetoutputMulti;
  575. Property outputValue : String Index 32 Read FoutputValue Write SetoutputValue;
  576. Property selfLink : String Index 40 Read FselfLink Write SetselfLink;
  577. end;
  578. TOutputClass = Class of TOutput;
  579. { --------------------------------------------------------------------
  580. TUpdate
  581. --------------------------------------------------------------------}
  582. TUpdate = Class(TGoogleBaseObject)
  583. Private
  584. FcsvInstance : TTJSONSchemaArray;
  585. Foutput : String;
  586. Protected
  587. //Property setters
  588. Procedure SetcsvInstance(AIndex : Integer; AValue : TTJSONSchemaArray); virtual;
  589. Procedure Setoutput(AIndex : Integer; AValue : String); virtual;
  590. //2.6.4. bug workaround
  591. {$IFDEF VER2_6}
  592. Procedure SetArrayLength(Const AName : String; ALength : Longint); override;
  593. {$ENDIF VER2_6}
  594. Public
  595. Published
  596. Property csvInstance : TTJSONSchemaArray Index 0 Read FcsvInstance Write SetcsvInstance;
  597. Property output : String Index 8 Read Foutput Write Setoutput;
  598. end;
  599. TUpdateClass = Class of TUpdate;
  600. { --------------------------------------------------------------------
  601. THostedmodelsResource
  602. --------------------------------------------------------------------}
  603. THostedmodelsResource = Class(TGoogleResource)
  604. Public
  605. Class Function ResourceName : String; override;
  606. Class Function DefaultAPI : TGoogleAPIClass; override;
  607. Function Predict(hostedModelName: string; project: string; aInput : TInput) : TOutput;
  608. end;
  609. { --------------------------------------------------------------------
  610. TTrainedmodelsResource
  611. --------------------------------------------------------------------}
  612. //Optional query Options for TTrainedmodelsResource, method List
  613. TTrainedmodelsListOptions = Record
  614. maxResults : integer;
  615. pageToken : String;
  616. end;
  617. TTrainedmodelsResource = Class(TGoogleResource)
  618. Public
  619. Class Function ResourceName : String; override;
  620. Class Function DefaultAPI : TGoogleAPIClass; override;
  621. Function Analyze(id: string; project: string) : TAnalyze;
  622. Procedure Delete(id: string; project: string);
  623. Function Get(id: string; project: string) : TInsert2;
  624. Function Insert(project: string; aInsert : TInsert) : TInsert2;
  625. Function List(project: string; AQuery : string = '') : TList;
  626. Function List(project: string; AQuery : TTrainedmodelslistOptions) : TList;
  627. Function Predict(id: string; project: string; aInput : TInput) : TOutput;
  628. Function Update(id: string; project: string; aUpdate : TUpdate) : TInsert2;
  629. end;
  630. { --------------------------------------------------------------------
  631. TPredictionAPI
  632. --------------------------------------------------------------------}
  633. TPredictionAPI = Class(TGoogleAPI)
  634. Private
  635. FHostedmodelsInstance : THostedmodelsResource;
  636. FTrainedmodelsInstance : TTrainedmodelsResource;
  637. Function GetHostedmodelsInstance : THostedmodelsResource;virtual;
  638. Function GetTrainedmodelsInstance : TTrainedmodelsResource;virtual;
  639. Public
  640. //Override class functions with API info
  641. Class Function APIName : String; override;
  642. Class Function APIVersion : String; override;
  643. Class Function APIRevision : String; override;
  644. Class Function APIID : String; override;
  645. Class Function APITitle : String; override;
  646. Class Function APIDescription : String; override;
  647. Class Function APIOwnerDomain : String; override;
  648. Class Function APIOwnerName : String; override;
  649. Class Function APIIcon16 : String; override;
  650. Class Function APIIcon32 : String; override;
  651. Class Function APIdocumentationLink : String; override;
  652. Class Function APIrootUrl : string; override;
  653. Class Function APIbasePath : string;override;
  654. Class Function APIbaseURL : String;override;
  655. Class Function APIProtocol : string;override;
  656. Class Function APIservicePath : string;override;
  657. Class Function APIbatchPath : String;override;
  658. Class Function APIAuthScopes : TScopeInfoArray;override;
  659. Class Function APINeedsAuth : Boolean;override;
  660. Class Procedure RegisterAPIResources; override;
  661. //Add create function for resources
  662. Function CreateHostedmodelsResource(AOwner : TComponent) : THostedmodelsResource;virtual;overload;
  663. Function CreateHostedmodelsResource : THostedmodelsResource;virtual;overload;
  664. Function CreateTrainedmodelsResource(AOwner : TComponent) : TTrainedmodelsResource;virtual;overload;
  665. Function CreateTrainedmodelsResource : TTrainedmodelsResource;virtual;overload;
  666. //Add default on-demand instances for resources
  667. Property HostedmodelsResource : THostedmodelsResource Read GetHostedmodelsInstance;
  668. Property TrainedmodelsResource : TTrainedmodelsResource Read GetTrainedmodelsInstance;
  669. end;
  670. implementation
  671. { --------------------------------------------------------------------
  672. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem
  673. --------------------------------------------------------------------}
  674. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem.Setcount(AIndex : Integer; AValue : String);
  675. begin
  676. If (Fcount=AValue) then exit;
  677. Fcount:=AValue;
  678. MarkPropertyChanged(AIndex);
  679. end;
  680. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem.Setvalue(AIndex : Integer; AValue : String);
  681. begin
  682. If (Fvalue=AValue) then exit;
  683. Fvalue:=AValue;
  684. MarkPropertyChanged(AIndex);
  685. end;
  686. { --------------------------------------------------------------------
  687. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical
  688. --------------------------------------------------------------------}
  689. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical.Setcount(AIndex : Integer; AValue : String);
  690. begin
  691. If (Fcount=AValue) then exit;
  692. Fcount:=AValue;
  693. MarkPropertyChanged(AIndex);
  694. end;
  695. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical.Setvalues(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesArray);
  696. begin
  697. If (Fvalues=AValue) then exit;
  698. Fvalues:=AValue;
  699. MarkPropertyChanged(AIndex);
  700. end;
  701. //2.6.4. bug workaround
  702. {$IFDEF VER2_6}
  703. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical.SetArrayLength(Const AName : String; ALength : Longint);
  704. begin
  705. Case AName of
  706. 'values' : SetLength(Fvalues,ALength);
  707. else
  708. Inherited SetArrayLength(AName,ALength);
  709. end;
  710. end;
  711. {$ENDIF VER2_6}
  712. { --------------------------------------------------------------------
  713. TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric
  714. --------------------------------------------------------------------}
  715. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric.Setcount(AIndex : Integer; AValue : String);
  716. begin
  717. If (Fcount=AValue) then exit;
  718. Fcount:=AValue;
  719. MarkPropertyChanged(AIndex);
  720. end;
  721. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric.Setmean(AIndex : Integer; AValue : String);
  722. begin
  723. If (Fmean=AValue) then exit;
  724. Fmean:=AValue;
  725. MarkPropertyChanged(AIndex);
  726. end;
  727. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric.Setvariance(AIndex : Integer; AValue : String);
  728. begin
  729. If (Fvariance=AValue) then exit;
  730. Fvariance:=AValue;
  731. MarkPropertyChanged(AIndex);
  732. end;
  733. { --------------------------------------------------------------------
  734. TAnalyzeTypedataDescriptionTypefeaturesItemTypetext
  735. --------------------------------------------------------------------}
  736. Procedure TAnalyzeTypedataDescriptionTypefeaturesItemTypetext.Setcount(AIndex : Integer; AValue : String);
  737. begin
  738. If (Fcount=AValue) then exit;
  739. Fcount:=AValue;
  740. MarkPropertyChanged(AIndex);
  741. end;
  742. { --------------------------------------------------------------------
  743. TAnalyzeTypedataDescriptionTypefeaturesItem
  744. --------------------------------------------------------------------}
  745. Procedure TAnalyzeTypedataDescriptionTypefeaturesItem.Setcategorical(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical);
  746. begin
  747. If (Fcategorical=AValue) then exit;
  748. Fcategorical:=AValue;
  749. MarkPropertyChanged(AIndex);
  750. end;
  751. Procedure TAnalyzeTypedataDescriptionTypefeaturesItem.Setindex(AIndex : Integer; AValue : String);
  752. begin
  753. If (Findex=AValue) then exit;
  754. Findex:=AValue;
  755. MarkPropertyChanged(AIndex);
  756. end;
  757. Procedure TAnalyzeTypedataDescriptionTypefeaturesItem.Setnumeric(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric);
  758. begin
  759. If (Fnumeric=AValue) then exit;
  760. Fnumeric:=AValue;
  761. MarkPropertyChanged(AIndex);
  762. end;
  763. Procedure TAnalyzeTypedataDescriptionTypefeaturesItem.Settext(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesItemTypetext);
  764. begin
  765. If (Ftext=AValue) then exit;
  766. Ftext:=AValue;
  767. MarkPropertyChanged(AIndex);
  768. end;
  769. { --------------------------------------------------------------------
  770. TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric
  771. --------------------------------------------------------------------}
  772. Procedure TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric.Setcount(AIndex : Integer; AValue : String);
  773. begin
  774. If (Fcount=AValue) then exit;
  775. Fcount:=AValue;
  776. MarkPropertyChanged(AIndex);
  777. end;
  778. Procedure TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric.Setmean(AIndex : Integer; AValue : String);
  779. begin
  780. If (Fmean=AValue) then exit;
  781. Fmean:=AValue;
  782. MarkPropertyChanged(AIndex);
  783. end;
  784. Procedure TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric.Setvariance(AIndex : Integer; AValue : String);
  785. begin
  786. If (Fvariance=AValue) then exit;
  787. Fvariance:=AValue;
  788. MarkPropertyChanged(AIndex);
  789. end;
  790. { --------------------------------------------------------------------
  791. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem
  792. --------------------------------------------------------------------}
  793. Procedure TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem.Setcount(AIndex : Integer; AValue : String);
  794. begin
  795. If (Fcount=AValue) then exit;
  796. Fcount:=AValue;
  797. MarkPropertyChanged(AIndex);
  798. end;
  799. Procedure TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem.Setvalue(AIndex : Integer; AValue : String);
  800. begin
  801. If (Fvalue=AValue) then exit;
  802. Fvalue:=AValue;
  803. MarkPropertyChanged(AIndex);
  804. end;
  805. { --------------------------------------------------------------------
  806. TAnalyzeTypedataDescriptionTypeoutputFeature
  807. --------------------------------------------------------------------}
  808. Procedure TAnalyzeTypedataDescriptionTypeoutputFeature.Setnumeric(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric);
  809. begin
  810. If (Fnumeric=AValue) then exit;
  811. Fnumeric:=AValue;
  812. MarkPropertyChanged(AIndex);
  813. end;
  814. Procedure TAnalyzeTypedataDescriptionTypeoutputFeature.Settext(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextArray);
  815. begin
  816. If (Ftext=AValue) then exit;
  817. Ftext:=AValue;
  818. MarkPropertyChanged(AIndex);
  819. end;
  820. //2.6.4. bug workaround
  821. {$IFDEF VER2_6}
  822. Procedure TAnalyzeTypedataDescriptionTypeoutputFeature.SetArrayLength(Const AName : String; ALength : Longint);
  823. begin
  824. Case AName of
  825. 'text' : SetLength(Ftext,ALength);
  826. else
  827. Inherited SetArrayLength(AName,ALength);
  828. end;
  829. end;
  830. {$ENDIF VER2_6}
  831. { --------------------------------------------------------------------
  832. TAnalyzeTypedataDescription
  833. --------------------------------------------------------------------}
  834. Procedure TAnalyzeTypedataDescription.Setfeatures(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypefeaturesArray);
  835. begin
  836. If (Ffeatures=AValue) then exit;
  837. Ffeatures:=AValue;
  838. MarkPropertyChanged(AIndex);
  839. end;
  840. Procedure TAnalyzeTypedataDescription.SetoutputFeature(AIndex : Integer; AValue : TAnalyzeTypedataDescriptionTypeoutputFeature);
  841. begin
  842. If (FoutputFeature=AValue) then exit;
  843. FoutputFeature:=AValue;
  844. MarkPropertyChanged(AIndex);
  845. end;
  846. //2.6.4. bug workaround
  847. {$IFDEF VER2_6}
  848. Procedure TAnalyzeTypedataDescription.SetArrayLength(Const AName : String; ALength : Longint);
  849. begin
  850. Case AName of
  851. 'features' : SetLength(Ffeatures,ALength);
  852. else
  853. Inherited SetArrayLength(AName,ALength);
  854. end;
  855. end;
  856. {$ENDIF VER2_6}
  857. { --------------------------------------------------------------------
  858. TAnalyzeTypeerrorsItem
  859. --------------------------------------------------------------------}
  860. Class Function TAnalyzeTypeerrorsItem.AllowAdditionalProperties : Boolean;
  861. begin
  862. Result:=True;
  863. end;
  864. { --------------------------------------------------------------------
  865. TAnalyzeTypemodelDescriptionTypeconfusionMatrix
  866. --------------------------------------------------------------------}
  867. Class Function TAnalyzeTypemodelDescriptionTypeconfusionMatrix.AllowAdditionalProperties : Boolean;
  868. begin
  869. Result:=True;
  870. end;
  871. { --------------------------------------------------------------------
  872. TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals
  873. --------------------------------------------------------------------}
  874. Class Function TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals.AllowAdditionalProperties : Boolean;
  875. begin
  876. Result:=True;
  877. end;
  878. { --------------------------------------------------------------------
  879. TAnalyzeTypemodelDescription
  880. --------------------------------------------------------------------}
  881. Procedure TAnalyzeTypemodelDescription.SetconfusionMatrix(AIndex : Integer; AValue : TAnalyzeTypemodelDescriptionTypeconfusionMatrix);
  882. begin
  883. If (FconfusionMatrix=AValue) then exit;
  884. FconfusionMatrix:=AValue;
  885. MarkPropertyChanged(AIndex);
  886. end;
  887. Procedure TAnalyzeTypemodelDescription.SetconfusionMatrixRowTotals(AIndex : Integer; AValue : TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals);
  888. begin
  889. If (FconfusionMatrixRowTotals=AValue) then exit;
  890. FconfusionMatrixRowTotals:=AValue;
  891. MarkPropertyChanged(AIndex);
  892. end;
  893. Procedure TAnalyzeTypemodelDescription.Setmodelinfo(AIndex : Integer; AValue : TInsert2);
  894. begin
  895. If (Fmodelinfo=AValue) then exit;
  896. Fmodelinfo:=AValue;
  897. MarkPropertyChanged(AIndex);
  898. end;
  899. { --------------------------------------------------------------------
  900. TAnalyze
  901. --------------------------------------------------------------------}
  902. Procedure TAnalyze.SetdataDescription(AIndex : Integer; AValue : TAnalyzeTypedataDescription);
  903. begin
  904. If (FdataDescription=AValue) then exit;
  905. FdataDescription:=AValue;
  906. MarkPropertyChanged(AIndex);
  907. end;
  908. Procedure TAnalyze.Seterrors(AIndex : Integer; AValue : TAnalyzeTypeerrorsArray);
  909. begin
  910. If (Ferrors=AValue) then exit;
  911. Ferrors:=AValue;
  912. MarkPropertyChanged(AIndex);
  913. end;
  914. Procedure TAnalyze.Setid(AIndex : Integer; AValue : String);
  915. begin
  916. If (Fid=AValue) then exit;
  917. Fid:=AValue;
  918. MarkPropertyChanged(AIndex);
  919. end;
  920. Procedure TAnalyze.Setkind(AIndex : Integer; AValue : String);
  921. begin
  922. If (Fkind=AValue) then exit;
  923. Fkind:=AValue;
  924. MarkPropertyChanged(AIndex);
  925. end;
  926. Procedure TAnalyze.SetmodelDescription(AIndex : Integer; AValue : TAnalyzeTypemodelDescription);
  927. begin
  928. If (FmodelDescription=AValue) then exit;
  929. FmodelDescription:=AValue;
  930. MarkPropertyChanged(AIndex);
  931. end;
  932. Procedure TAnalyze.SetselfLink(AIndex : Integer; AValue : String);
  933. begin
  934. If (FselfLink=AValue) then exit;
  935. FselfLink:=AValue;
  936. MarkPropertyChanged(AIndex);
  937. end;
  938. //2.6.4. bug workaround
  939. {$IFDEF VER2_6}
  940. Procedure TAnalyze.SetArrayLength(Const AName : String; ALength : Longint);
  941. begin
  942. Case AName of
  943. 'errors' : SetLength(Ferrors,ALength);
  944. else
  945. Inherited SetArrayLength(AName,ALength);
  946. end;
  947. end;
  948. {$ENDIF VER2_6}
  949. { --------------------------------------------------------------------
  950. TInputTypeinput
  951. --------------------------------------------------------------------}
  952. Procedure TInputTypeinput.SetcsvInstance(AIndex : Integer; AValue : TTJSONSchemaArray);
  953. begin
  954. If (FcsvInstance=AValue) then exit;
  955. FcsvInstance:=AValue;
  956. MarkPropertyChanged(AIndex);
  957. end;
  958. //2.6.4. bug workaround
  959. {$IFDEF VER2_6}
  960. Procedure TInputTypeinput.SetArrayLength(Const AName : String; ALength : Longint);
  961. begin
  962. Case AName of
  963. 'csvinstance' : SetLength(FcsvInstance,ALength);
  964. else
  965. Inherited SetArrayLength(AName,ALength);
  966. end;
  967. end;
  968. {$ENDIF VER2_6}
  969. { --------------------------------------------------------------------
  970. TInput
  971. --------------------------------------------------------------------}
  972. Procedure TInput.Setinput(AIndex : Integer; AValue : TInputTypeinput);
  973. begin
  974. If (Finput=AValue) then exit;
  975. Finput:=AValue;
  976. MarkPropertyChanged(AIndex);
  977. end;
  978. { --------------------------------------------------------------------
  979. TInsertTypetrainingInstancesItem
  980. --------------------------------------------------------------------}
  981. Procedure TInsertTypetrainingInstancesItem.SetcsvInstance(AIndex : Integer; AValue : TTJSONSchemaArray);
  982. begin
  983. If (FcsvInstance=AValue) then exit;
  984. FcsvInstance:=AValue;
  985. MarkPropertyChanged(AIndex);
  986. end;
  987. Procedure TInsertTypetrainingInstancesItem.Setoutput(AIndex : Integer; AValue : String);
  988. begin
  989. If (Foutput=AValue) then exit;
  990. Foutput:=AValue;
  991. MarkPropertyChanged(AIndex);
  992. end;
  993. //2.6.4. bug workaround
  994. {$IFDEF VER2_6}
  995. Procedure TInsertTypetrainingInstancesItem.SetArrayLength(Const AName : String; ALength : Longint);
  996. begin
  997. Case AName of
  998. 'csvinstance' : SetLength(FcsvInstance,ALength);
  999. else
  1000. Inherited SetArrayLength(AName,ALength);
  1001. end;
  1002. end;
  1003. {$ENDIF VER2_6}
  1004. { --------------------------------------------------------------------
  1005. TInsertTypeutilityItem
  1006. --------------------------------------------------------------------}
  1007. Class Function TInsertTypeutilityItem.AllowAdditionalProperties : Boolean;
  1008. begin
  1009. Result:=True;
  1010. end;
  1011. { --------------------------------------------------------------------
  1012. TInsert
  1013. --------------------------------------------------------------------}
  1014. Procedure TInsert.Setid(AIndex : Integer; AValue : String);
  1015. begin
  1016. If (Fid=AValue) then exit;
  1017. Fid:=AValue;
  1018. MarkPropertyChanged(AIndex);
  1019. end;
  1020. Procedure TInsert.SetmodelType(AIndex : Integer; AValue : String);
  1021. begin
  1022. If (FmodelType=AValue) then exit;
  1023. FmodelType:=AValue;
  1024. MarkPropertyChanged(AIndex);
  1025. end;
  1026. Procedure TInsert.SetsourceModel(AIndex : Integer; AValue : String);
  1027. begin
  1028. If (FsourceModel=AValue) then exit;
  1029. FsourceModel:=AValue;
  1030. MarkPropertyChanged(AIndex);
  1031. end;
  1032. Procedure TInsert.SetstorageDataLocation(AIndex : Integer; AValue : String);
  1033. begin
  1034. If (FstorageDataLocation=AValue) then exit;
  1035. FstorageDataLocation:=AValue;
  1036. MarkPropertyChanged(AIndex);
  1037. end;
  1038. Procedure TInsert.SetstoragePMMLLocation(AIndex : Integer; AValue : String);
  1039. begin
  1040. If (FstoragePMMLLocation=AValue) then exit;
  1041. FstoragePMMLLocation:=AValue;
  1042. MarkPropertyChanged(AIndex);
  1043. end;
  1044. Procedure TInsert.SetstoragePMMLModelLocation(AIndex : Integer; AValue : String);
  1045. begin
  1046. If (FstoragePMMLModelLocation=AValue) then exit;
  1047. FstoragePMMLModelLocation:=AValue;
  1048. MarkPropertyChanged(AIndex);
  1049. end;
  1050. Procedure TInsert.SettrainingInstances(AIndex : Integer; AValue : TInsertTypetrainingInstancesArray);
  1051. begin
  1052. If (FtrainingInstances=AValue) then exit;
  1053. FtrainingInstances:=AValue;
  1054. MarkPropertyChanged(AIndex);
  1055. end;
  1056. Procedure TInsert.Setutility(AIndex : Integer; AValue : TInsertTypeutilityArray);
  1057. begin
  1058. If (Futility=AValue) then exit;
  1059. Futility:=AValue;
  1060. MarkPropertyChanged(AIndex);
  1061. end;
  1062. //2.6.4. bug workaround
  1063. {$IFDEF VER2_6}
  1064. Procedure TInsert.SetArrayLength(Const AName : String; ALength : Longint);
  1065. begin
  1066. Case AName of
  1067. 'traininginstances' : SetLength(FtrainingInstances,ALength);
  1068. 'utility' : SetLength(Futility,ALength);
  1069. else
  1070. Inherited SetArrayLength(AName,ALength);
  1071. end;
  1072. end;
  1073. {$ENDIF VER2_6}
  1074. { --------------------------------------------------------------------
  1075. TInsert2TypemodelInfo
  1076. --------------------------------------------------------------------}
  1077. Procedure TInsert2TypemodelInfo.SetclassWeightedAccuracy(AIndex : Integer; AValue : String);
  1078. begin
  1079. If (FclassWeightedAccuracy=AValue) then exit;
  1080. FclassWeightedAccuracy:=AValue;
  1081. MarkPropertyChanged(AIndex);
  1082. end;
  1083. Procedure TInsert2TypemodelInfo.SetclassificationAccuracy(AIndex : Integer; AValue : String);
  1084. begin
  1085. If (FclassificationAccuracy=AValue) then exit;
  1086. FclassificationAccuracy:=AValue;
  1087. MarkPropertyChanged(AIndex);
  1088. end;
  1089. Procedure TInsert2TypemodelInfo.SetmeanSquaredError(AIndex : Integer; AValue : String);
  1090. begin
  1091. If (FmeanSquaredError=AValue) then exit;
  1092. FmeanSquaredError:=AValue;
  1093. MarkPropertyChanged(AIndex);
  1094. end;
  1095. Procedure TInsert2TypemodelInfo.SetmodelType(AIndex : Integer; AValue : String);
  1096. begin
  1097. If (FmodelType=AValue) then exit;
  1098. FmodelType:=AValue;
  1099. MarkPropertyChanged(AIndex);
  1100. end;
  1101. Procedure TInsert2TypemodelInfo.SetnumberInstances(AIndex : Integer; AValue : String);
  1102. begin
  1103. If (FnumberInstances=AValue) then exit;
  1104. FnumberInstances:=AValue;
  1105. MarkPropertyChanged(AIndex);
  1106. end;
  1107. Procedure TInsert2TypemodelInfo.SetnumberLabels(AIndex : Integer; AValue : String);
  1108. begin
  1109. If (FnumberLabels=AValue) then exit;
  1110. FnumberLabels:=AValue;
  1111. MarkPropertyChanged(AIndex);
  1112. end;
  1113. { --------------------------------------------------------------------
  1114. TInsert2
  1115. --------------------------------------------------------------------}
  1116. Procedure TInsert2.Setcreated(AIndex : Integer; AValue : TDatetime);
  1117. begin
  1118. If (Fcreated=AValue) then exit;
  1119. Fcreated:=AValue;
  1120. MarkPropertyChanged(AIndex);
  1121. end;
  1122. Procedure TInsert2.Setid(AIndex : Integer; AValue : String);
  1123. begin
  1124. If (Fid=AValue) then exit;
  1125. Fid:=AValue;
  1126. MarkPropertyChanged(AIndex);
  1127. end;
  1128. Procedure TInsert2.Setkind(AIndex : Integer; AValue : String);
  1129. begin
  1130. If (Fkind=AValue) then exit;
  1131. Fkind:=AValue;
  1132. MarkPropertyChanged(AIndex);
  1133. end;
  1134. Procedure TInsert2.SetmodelInfo(AIndex : Integer; AValue : TInsert2TypemodelInfo);
  1135. begin
  1136. If (FmodelInfo=AValue) then exit;
  1137. FmodelInfo:=AValue;
  1138. MarkPropertyChanged(AIndex);
  1139. end;
  1140. Procedure TInsert2.SetmodelType(AIndex : Integer; AValue : String);
  1141. begin
  1142. If (FmodelType=AValue) then exit;
  1143. FmodelType:=AValue;
  1144. MarkPropertyChanged(AIndex);
  1145. end;
  1146. Procedure TInsert2.SetselfLink(AIndex : Integer; AValue : String);
  1147. begin
  1148. If (FselfLink=AValue) then exit;
  1149. FselfLink:=AValue;
  1150. MarkPropertyChanged(AIndex);
  1151. end;
  1152. Procedure TInsert2.SetstorageDataLocation(AIndex : Integer; AValue : String);
  1153. begin
  1154. If (FstorageDataLocation=AValue) then exit;
  1155. FstorageDataLocation:=AValue;
  1156. MarkPropertyChanged(AIndex);
  1157. end;
  1158. Procedure TInsert2.SetstoragePMMLLocation(AIndex : Integer; AValue : String);
  1159. begin
  1160. If (FstoragePMMLLocation=AValue) then exit;
  1161. FstoragePMMLLocation:=AValue;
  1162. MarkPropertyChanged(AIndex);
  1163. end;
  1164. Procedure TInsert2.SetstoragePMMLModelLocation(AIndex : Integer; AValue : String);
  1165. begin
  1166. If (FstoragePMMLModelLocation=AValue) then exit;
  1167. FstoragePMMLModelLocation:=AValue;
  1168. MarkPropertyChanged(AIndex);
  1169. end;
  1170. Procedure TInsert2.SettrainingComplete(AIndex : Integer; AValue : TDatetime);
  1171. begin
  1172. If (FtrainingComplete=AValue) then exit;
  1173. FtrainingComplete:=AValue;
  1174. MarkPropertyChanged(AIndex);
  1175. end;
  1176. Procedure TInsert2.SettrainingStatus(AIndex : Integer; AValue : String);
  1177. begin
  1178. If (FtrainingStatus=AValue) then exit;
  1179. FtrainingStatus:=AValue;
  1180. MarkPropertyChanged(AIndex);
  1181. end;
  1182. { --------------------------------------------------------------------
  1183. TList
  1184. --------------------------------------------------------------------}
  1185. Procedure TList.Setitems(AIndex : Integer; AValue : TListTypeitemsArray);
  1186. begin
  1187. If (Fitems=AValue) then exit;
  1188. Fitems:=AValue;
  1189. MarkPropertyChanged(AIndex);
  1190. end;
  1191. Procedure TList.Setkind(AIndex : Integer; AValue : String);
  1192. begin
  1193. If (Fkind=AValue) then exit;
  1194. Fkind:=AValue;
  1195. MarkPropertyChanged(AIndex);
  1196. end;
  1197. Procedure TList.SetnextPageToken(AIndex : Integer; AValue : String);
  1198. begin
  1199. If (FnextPageToken=AValue) then exit;
  1200. FnextPageToken:=AValue;
  1201. MarkPropertyChanged(AIndex);
  1202. end;
  1203. Procedure TList.SetselfLink(AIndex : Integer; AValue : String);
  1204. begin
  1205. If (FselfLink=AValue) then exit;
  1206. FselfLink:=AValue;
  1207. MarkPropertyChanged(AIndex);
  1208. end;
  1209. //2.6.4. bug workaround
  1210. {$IFDEF VER2_6}
  1211. Procedure TList.SetArrayLength(Const AName : String; ALength : Longint);
  1212. begin
  1213. Case AName of
  1214. 'items' : SetLength(Fitems,ALength);
  1215. else
  1216. Inherited SetArrayLength(AName,ALength);
  1217. end;
  1218. end;
  1219. {$ENDIF VER2_6}
  1220. { --------------------------------------------------------------------
  1221. TOutputTypeoutputMultiItem
  1222. --------------------------------------------------------------------}
  1223. Procedure TOutputTypeoutputMultiItem.Set_label(AIndex : Integer; AValue : String);
  1224. begin
  1225. If (F_label=AValue) then exit;
  1226. F_label:=AValue;
  1227. MarkPropertyChanged(AIndex);
  1228. end;
  1229. Procedure TOutputTypeoutputMultiItem.Setscore(AIndex : Integer; AValue : String);
  1230. begin
  1231. If (Fscore=AValue) then exit;
  1232. Fscore:=AValue;
  1233. MarkPropertyChanged(AIndex);
  1234. end;
  1235. Class Function TOutputTypeoutputMultiItem.ExportPropertyName(Const AName : String) :String;
  1236. begin
  1237. Case AName of
  1238. '_label' : Result:='label';
  1239. else
  1240. Result:=Inherited ExportPropertyName(AName);
  1241. end;
  1242. end;
  1243. { --------------------------------------------------------------------
  1244. TOutput
  1245. --------------------------------------------------------------------}
  1246. Procedure TOutput.Setid(AIndex : Integer; AValue : String);
  1247. begin
  1248. If (Fid=AValue) then exit;
  1249. Fid:=AValue;
  1250. MarkPropertyChanged(AIndex);
  1251. end;
  1252. Procedure TOutput.Setkind(AIndex : Integer; AValue : String);
  1253. begin
  1254. If (Fkind=AValue) then exit;
  1255. Fkind:=AValue;
  1256. MarkPropertyChanged(AIndex);
  1257. end;
  1258. Procedure TOutput.SetoutputLabel(AIndex : Integer; AValue : String);
  1259. begin
  1260. If (FoutputLabel=AValue) then exit;
  1261. FoutputLabel:=AValue;
  1262. MarkPropertyChanged(AIndex);
  1263. end;
  1264. Procedure TOutput.SetoutputMulti(AIndex : Integer; AValue : TOutputTypeoutputMultiArray);
  1265. begin
  1266. If (FoutputMulti=AValue) then exit;
  1267. FoutputMulti:=AValue;
  1268. MarkPropertyChanged(AIndex);
  1269. end;
  1270. Procedure TOutput.SetoutputValue(AIndex : Integer; AValue : String);
  1271. begin
  1272. If (FoutputValue=AValue) then exit;
  1273. FoutputValue:=AValue;
  1274. MarkPropertyChanged(AIndex);
  1275. end;
  1276. Procedure TOutput.SetselfLink(AIndex : Integer; AValue : String);
  1277. begin
  1278. If (FselfLink=AValue) then exit;
  1279. FselfLink:=AValue;
  1280. MarkPropertyChanged(AIndex);
  1281. end;
  1282. //2.6.4. bug workaround
  1283. {$IFDEF VER2_6}
  1284. Procedure TOutput.SetArrayLength(Const AName : String; ALength : Longint);
  1285. begin
  1286. Case AName of
  1287. 'outputmulti' : SetLength(FoutputMulti,ALength);
  1288. else
  1289. Inherited SetArrayLength(AName,ALength);
  1290. end;
  1291. end;
  1292. {$ENDIF VER2_6}
  1293. { --------------------------------------------------------------------
  1294. TUpdate
  1295. --------------------------------------------------------------------}
  1296. Procedure TUpdate.SetcsvInstance(AIndex : Integer; AValue : TTJSONSchemaArray);
  1297. begin
  1298. If (FcsvInstance=AValue) then exit;
  1299. FcsvInstance:=AValue;
  1300. MarkPropertyChanged(AIndex);
  1301. end;
  1302. Procedure TUpdate.Setoutput(AIndex : Integer; AValue : String);
  1303. begin
  1304. If (Foutput=AValue) then exit;
  1305. Foutput:=AValue;
  1306. MarkPropertyChanged(AIndex);
  1307. end;
  1308. //2.6.4. bug workaround
  1309. {$IFDEF VER2_6}
  1310. Procedure TUpdate.SetArrayLength(Const AName : String; ALength : Longint);
  1311. begin
  1312. Case AName of
  1313. 'csvinstance' : SetLength(FcsvInstance,ALength);
  1314. else
  1315. Inherited SetArrayLength(AName,ALength);
  1316. end;
  1317. end;
  1318. {$ENDIF VER2_6}
  1319. { --------------------------------------------------------------------
  1320. THostedmodelsResource
  1321. --------------------------------------------------------------------}
  1322. Class Function THostedmodelsResource.ResourceName : String;
  1323. begin
  1324. Result:='hostedmodels';
  1325. end;
  1326. Class Function THostedmodelsResource.DefaultAPI : TGoogleAPIClass;
  1327. begin
  1328. Result:=TpredictionAPI;
  1329. end;
  1330. Function THostedmodelsResource.Predict(hostedModelName: string; project: string; aInput : TInput) : TOutput;
  1331. Const
  1332. _HTTPMethod = 'POST';
  1333. _Path = '{project}/hostedmodels/{hostedModelName}/predict';
  1334. _Methodid = 'prediction.hostedmodels.predict';
  1335. Var
  1336. _P : String;
  1337. begin
  1338. _P:=SubstitutePath(_Path,['hostedModelName',hostedModelName,'project',project]);
  1339. Result:=ServiceCall(_HTTPMethod,_P,'',aInput,TOutput) as TOutput;
  1340. end;
  1341. { --------------------------------------------------------------------
  1342. TTrainedmodelsResource
  1343. --------------------------------------------------------------------}
  1344. Class Function TTrainedmodelsResource.ResourceName : String;
  1345. begin
  1346. Result:='trainedmodels';
  1347. end;
  1348. Class Function TTrainedmodelsResource.DefaultAPI : TGoogleAPIClass;
  1349. begin
  1350. Result:=TpredictionAPI;
  1351. end;
  1352. Function TTrainedmodelsResource.Analyze(id: string; project: string) : TAnalyze;
  1353. Const
  1354. _HTTPMethod = 'GET';
  1355. _Path = '{project}/trainedmodels/{id}/analyze';
  1356. _Methodid = 'prediction.trainedmodels.analyze';
  1357. Var
  1358. _P : String;
  1359. begin
  1360. _P:=SubstitutePath(_Path,['id',id,'project',project]);
  1361. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TAnalyze) as TAnalyze;
  1362. end;
  1363. Procedure TTrainedmodelsResource.Delete(id: string; project: string);
  1364. Const
  1365. _HTTPMethod = 'DELETE';
  1366. _Path = '{project}/trainedmodels/{id}';
  1367. _Methodid = 'prediction.trainedmodels.delete';
  1368. Var
  1369. _P : String;
  1370. begin
  1371. _P:=SubstitutePath(_Path,['id',id,'project',project]);
  1372. ServiceCall(_HTTPMethod,_P,'',Nil,Nil);
  1373. end;
  1374. Function TTrainedmodelsResource.Get(id: string; project: string) : TInsert2;
  1375. Const
  1376. _HTTPMethod = 'GET';
  1377. _Path = '{project}/trainedmodels/{id}';
  1378. _Methodid = 'prediction.trainedmodels.get';
  1379. Var
  1380. _P : String;
  1381. begin
  1382. _P:=SubstitutePath(_Path,['id',id,'project',project]);
  1383. Result:=ServiceCall(_HTTPMethod,_P,'',Nil,TInsert2) as TInsert2;
  1384. end;
  1385. Function TTrainedmodelsResource.Insert(project: string; aInsert : TInsert) : TInsert2;
  1386. Const
  1387. _HTTPMethod = 'POST';
  1388. _Path = '{project}/trainedmodels';
  1389. _Methodid = 'prediction.trainedmodels.insert';
  1390. Var
  1391. _P : String;
  1392. begin
  1393. _P:=SubstitutePath(_Path,['project',project]);
  1394. Result:=ServiceCall(_HTTPMethod,_P,'',aInsert,TInsert2) as TInsert2;
  1395. end;
  1396. Function TTrainedmodelsResource.List(project: string; AQuery : string = '') : TList;
  1397. Const
  1398. _HTTPMethod = 'GET';
  1399. _Path = '{project}/trainedmodels/list';
  1400. _Methodid = 'prediction.trainedmodels.list';
  1401. Var
  1402. _P : String;
  1403. begin
  1404. _P:=SubstitutePath(_Path,['project',project]);
  1405. Result:=ServiceCall(_HTTPMethod,_P,AQuery,Nil,TList) as TList;
  1406. end;
  1407. Function TTrainedmodelsResource.List(project: string; AQuery : TTrainedmodelslistOptions) : TList;
  1408. Var
  1409. _Q : String;
  1410. begin
  1411. _Q:='';
  1412. AddToQuery(_Q,'maxResults',AQuery.maxResults);
  1413. AddToQuery(_Q,'pageToken',AQuery.pageToken);
  1414. Result:=List(project,_Q);
  1415. end;
  1416. Function TTrainedmodelsResource.Predict(id: string; project: string; aInput : TInput) : TOutput;
  1417. Const
  1418. _HTTPMethod = 'POST';
  1419. _Path = '{project}/trainedmodels/{id}/predict';
  1420. _Methodid = 'prediction.trainedmodels.predict';
  1421. Var
  1422. _P : String;
  1423. begin
  1424. _P:=SubstitutePath(_Path,['id',id,'project',project]);
  1425. Result:=ServiceCall(_HTTPMethod,_P,'',aInput,TOutput) as TOutput;
  1426. end;
  1427. Function TTrainedmodelsResource.Update(id: string; project: string; aUpdate : TUpdate) : TInsert2;
  1428. Const
  1429. _HTTPMethod = 'PUT';
  1430. _Path = '{project}/trainedmodels/{id}';
  1431. _Methodid = 'prediction.trainedmodels.update';
  1432. Var
  1433. _P : String;
  1434. begin
  1435. _P:=SubstitutePath(_Path,['id',id,'project',project]);
  1436. Result:=ServiceCall(_HTTPMethod,_P,'',aUpdate,TInsert2) as TInsert2;
  1437. end;
  1438. { --------------------------------------------------------------------
  1439. TPredictionAPI
  1440. --------------------------------------------------------------------}
  1441. Class Function TPredictionAPI.APIName : String;
  1442. begin
  1443. Result:='prediction';
  1444. end;
  1445. Class Function TPredictionAPI.APIVersion : String;
  1446. begin
  1447. Result:='v1.6';
  1448. end;
  1449. Class Function TPredictionAPI.APIRevision : String;
  1450. begin
  1451. Result:='20140522';
  1452. end;
  1453. Class Function TPredictionAPI.APIID : String;
  1454. begin
  1455. Result:='prediction:v1.6';
  1456. end;
  1457. Class Function TPredictionAPI.APITitle : String;
  1458. begin
  1459. Result:='Prediction API';
  1460. end;
  1461. Class Function TPredictionAPI.APIDescription : String;
  1462. begin
  1463. Result:='Lets you access a cloud hosted machine learning service that makes it easy to build smart apps';
  1464. end;
  1465. Class Function TPredictionAPI.APIOwnerDomain : String;
  1466. begin
  1467. Result:='google.com';
  1468. end;
  1469. Class Function TPredictionAPI.APIOwnerName : String;
  1470. begin
  1471. Result:='Google';
  1472. end;
  1473. Class Function TPredictionAPI.APIIcon16 : String;
  1474. begin
  1475. Result:='http://www.google.com/images/icons/feature/predictionapi-16.png';
  1476. end;
  1477. Class Function TPredictionAPI.APIIcon32 : String;
  1478. begin
  1479. Result:='http://www.google.com/images/icons/feature/predictionapi-32.png';
  1480. end;
  1481. Class Function TPredictionAPI.APIdocumentationLink : String;
  1482. begin
  1483. Result:='https://developers.google.com/prediction/docs/developer-guide';
  1484. end;
  1485. Class Function TPredictionAPI.APIrootUrl : string;
  1486. begin
  1487. Result:='https://www.googleapis.com:443/';
  1488. end;
  1489. Class Function TPredictionAPI.APIbasePath : string;
  1490. begin
  1491. Result:='/prediction/v1.6/projects/';
  1492. end;
  1493. Class Function TPredictionAPI.APIbaseURL : String;
  1494. begin
  1495. Result:='https://www.googleapis.com:443/prediction/v1.6/projects/';
  1496. end;
  1497. Class Function TPredictionAPI.APIProtocol : string;
  1498. begin
  1499. Result:='rest';
  1500. end;
  1501. Class Function TPredictionAPI.APIservicePath : string;
  1502. begin
  1503. Result:='prediction/v1.6/projects/';
  1504. end;
  1505. Class Function TPredictionAPI.APIbatchPath : String;
  1506. begin
  1507. Result:='batch';
  1508. end;
  1509. Class Function TPredictionAPI.APIAuthScopes : TScopeInfoArray;
  1510. begin
  1511. SetLength(Result,4);
  1512. Result[0].Name:='https://www.googleapis.com/auth/devstorage.full_control';
  1513. Result[0].Description:='Manage your data and permissions in Google Cloud Storage';
  1514. Result[1].Name:='https://www.googleapis.com/auth/devstorage.read_only';
  1515. Result[1].Description:='View your data in Google Cloud Storage';
  1516. Result[2].Name:='https://www.googleapis.com/auth/devstorage.read_write';
  1517. Result[2].Description:='Manage your data in Google Cloud Storage';
  1518. Result[3].Name:='https://www.googleapis.com/auth/prediction';
  1519. Result[3].Description:='Manage your data in the Google Prediction API';
  1520. end;
  1521. Class Function TPredictionAPI.APINeedsAuth : Boolean;
  1522. begin
  1523. Result:=True;
  1524. end;
  1525. Class Procedure TPredictionAPI.RegisterAPIResources;
  1526. begin
  1527. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategoricalTypevaluesItem.RegisterObject;
  1528. TAnalyzeTypedataDescriptionTypefeaturesItemTypecategorical.RegisterObject;
  1529. TAnalyzeTypedataDescriptionTypefeaturesItemTypenumeric.RegisterObject;
  1530. TAnalyzeTypedataDescriptionTypefeaturesItemTypetext.RegisterObject;
  1531. TAnalyzeTypedataDescriptionTypefeaturesItem.RegisterObject;
  1532. TAnalyzeTypedataDescriptionTypeoutputFeatureTypenumeric.RegisterObject;
  1533. TAnalyzeTypedataDescriptionTypeoutputFeatureTypetextItem.RegisterObject;
  1534. TAnalyzeTypedataDescriptionTypeoutputFeature.RegisterObject;
  1535. TAnalyzeTypedataDescription.RegisterObject;
  1536. TAnalyzeTypeerrorsItem.RegisterObject;
  1537. TAnalyzeTypemodelDescriptionTypeconfusionMatrix.RegisterObject;
  1538. TAnalyzeTypemodelDescriptionTypeconfusionMatrixRowTotals.RegisterObject;
  1539. TAnalyzeTypemodelDescription.RegisterObject;
  1540. TAnalyze.RegisterObject;
  1541. TInputTypeinput.RegisterObject;
  1542. TInput.RegisterObject;
  1543. TInsertTypetrainingInstancesItem.RegisterObject;
  1544. TInsertTypeutilityItem.RegisterObject;
  1545. TInsert.RegisterObject;
  1546. TInsert2TypemodelInfo.RegisterObject;
  1547. TInsert2.RegisterObject;
  1548. TList.RegisterObject;
  1549. TOutputTypeoutputMultiItem.RegisterObject;
  1550. TOutput.RegisterObject;
  1551. TUpdate.RegisterObject;
  1552. end;
  1553. Function TPredictionAPI.GetHostedmodelsInstance : THostedmodelsResource;
  1554. begin
  1555. if (FHostedmodelsInstance=Nil) then
  1556. FHostedmodelsInstance:=CreateHostedmodelsResource;
  1557. Result:=FHostedmodelsInstance;
  1558. end;
  1559. Function TPredictionAPI.CreateHostedmodelsResource : THostedmodelsResource;
  1560. begin
  1561. Result:=CreateHostedmodelsResource(Self);
  1562. end;
  1563. Function TPredictionAPI.CreateHostedmodelsResource(AOwner : TComponent) : THostedmodelsResource;
  1564. begin
  1565. Result:=THostedmodelsResource.Create(AOwner);
  1566. Result.API:=Self.API;
  1567. end;
  1568. Function TPredictionAPI.GetTrainedmodelsInstance : TTrainedmodelsResource;
  1569. begin
  1570. if (FTrainedmodelsInstance=Nil) then
  1571. FTrainedmodelsInstance:=CreateTrainedmodelsResource;
  1572. Result:=FTrainedmodelsInstance;
  1573. end;
  1574. Function TPredictionAPI.CreateTrainedmodelsResource : TTrainedmodelsResource;
  1575. begin
  1576. Result:=CreateTrainedmodelsResource(Self);
  1577. end;
  1578. Function TPredictionAPI.CreateTrainedmodelsResource(AOwner : TComponent) : TTrainedmodelsResource;
  1579. begin
  1580. Result:=TTrainedmodelsResource.Create(AOwner);
  1581. Result.API:=Self.API;
  1582. end;
  1583. initialization
  1584. TPredictionAPI.RegisterAPI;
  1585. end.