"All scikit-learn's `fit` methods require a 2D array of size `[n_samples x n_features]`. So we transform our `Pandas.DateTimeIndex` into an array of time deltas describing how many days have passed since the first observation and call the days method to get just the numbers of days instead of a TimeDelta object. Something like this:\n",
"All scikit-learn's `fit` methods require a 2D array of size `[n_samples x n_features]`. So we transform our `Pandas.DateTimeIndex` into an array of time deltas describing how many days have passed since the first observation and call the \"**`days`**\" method to get just the numbers of days instead of a TimeDelta object. Something like this:\n",
"\n",
"```python\n",
"[1 ,2 ,3 , 4, ..., n_samples]\n",
...
...
@@ -301,8 +301,7 @@
"[[1], [2], [3], ..., [n_samples]]\n",
"```\n",
"\n",
"If we had more features, each element of the outter array \n",
"would have more than one element. \n",
"If we had more features, each inner array would have more than one element. \n",
"\n",
"But, not everything are flowers. As you can see this prediction is really, really bad. Consering that you will have almost the same sales in the next year, you won't be able to fulfil the same demands you did before and you will keep a very high stock during the lower demand period. \n",
"\n",
...
...
@@ -367,14 +366,14 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"# Statistical analysis (auto correlation and partial auto correlation)\n",
"# Statistical analysis (autocorrelation and partial autocorrelation)\n",
"\n",
"Now you need to idenfity which ARIMA model order fits better your data. So you will need to plot both the auto correlation and partial auto correlation graphs and analyse them. 'statsmodels' provide an easy to use method to plot both these graphs, check the snippet below."
"Now you need to idenfity which ARIMA model order fits better your data. So you will need to plot both the autocorrelation and partial autocorrelation graphs and analyse them. 'statsmodels' provide an easy to use method to plot both these graphs, check the snippet below."
"Looks like partial auto correlation goes to 0 after lag 3. So **ARMA(3,0)** looks like an adequated model for our data. Auto correlation graph shows information about another model that might be good but require a different analysis, which isn't the real focus of this tutorial.\n",
"Looks like partial autocorrelation goes to 0 after lag 3. So **ARMA(3,0)** looks like an adequated model for our data. Autocorrelation graph shows information about another model that might be good but require a different analysis, which isn't the real focus of this tutorial.\n",
"\n",
"An important thing to note is that there are mathematical methods to give suggestions of model orders for your data. You will get to know them in the next section."