googleprediction.pp 64 KB

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