# How to use the function Predict[] with variable-length dataset?

I can use the function Predict[] with pre-defined dataset successfully.

A = {1, 2, 3, 4, 5, 6, 7, 8, 9} -> {1, 2, 3, 4, 5, 6, 7, 8, 9}^3;
p = Predict[A]


However, when the length of dataset is unknown. How can I to build the dataset in runtime?

e.g.

(* There are 125 items, the length is unknown until runtime *)
data = {123.5, 123,1, 123.2, 123.3, 123.6,......}

(* "Argument {1,8,27,64,125,216,343,512,729} should be a rule or a list of rules" *)
p = predict[data]


• I'm not sure I understand. What do you want to provide to a Predict assuming you have data = {1.1, 2.1, 3.1} and assuming the length of data isn't known a priori. – Kuba Apr 11 '16 at 11:25
• Like (Range@Length@# -> #) &@data? – Kuba Apr 11 '16 at 11:51