A method for use in determination of insulin pump settings, the method comprising: performing unsupervised learning of the insulin pump settings, said unsupervised learning comprising: (a) obtaining raw log data input accumulated on one or more glucose monitoring units recording glucose levels of a single treated patient along a certain time window; (b) determining informative data piece from raw log data input being sectioned to at least one data section, the informative data piece being determined from said at least one data section, wherein the at least one data section includes a Basal Section, BaS, corresponding to a time window having a starting point and an end point and being distant in time from the effect of insulin bolus or meals; and (c) calculating global insulin pump settings from the informative data piece, wherein said settings include a basal plan consisting of several basal rates delivered at different times of the day, wherein the raw log data input of said Basal Section includes a series of basal rates as a function of time; characterised by the method comprising: determining a time delay, A, characterizing the treated patient at said Basal Section, said time delay being between a basal treatment rate delivery time and corresponding changes in the glucose level; obtaining a plurality of basal rates at a delivery time from said series of basal rates, a respective paired glucose level being at the time delay measured from the delivery time; determining a resultant basal rate from the plurality of basal rates which minimizes a change in the glucose level after said time delay, A. performing unsupervised learning of the insulin pump settings, said unsupervised learning comprising: (a) obtaining raw log data input accumulated on one or more glucose monitoring units recording glucose levels of a single treated patient along a certain time window; (b) determining informative data piece from raw log data input being sectioned to at least one data section, the informative data piece being determined from said at least one data section, wherein the at least one data section includes a Basal Section, BaS, corresponding to a time window having a starting point and an end point and being distant in time from the effect of insulin bolus or meals; and (c) calculating global insulin pump settings from the informative data piece, wherein said settings include a basal plan consisting of several basal rates delivered at different times of the day, wherein the raw log data input of said Basal Section includes a series of basal rates as a function of time; characterised by (a) obtaining raw log data input accumulated on one or more glucose monitoring units recording glucose levels of a single treated patient along a certain time window; (b) determining informative data piece from raw log data input being sectioned to at least one data section, the informative data piece being determined from said at least one data section, wherein the at least one data section includes a Basal Section, BaS, corresponding to a time window having a starting point and an end point and being distant in time from the effect of insulin bolus or meals; and (c) calculating global insulin pump settings from the informative data piece, wherein said settings include a basal plan consisting of several basal rates delivered at different times of the day,