Commit 4bfce68f authored by Douglas's avatar Douglas

fixes typos

parent 960ef3d5
......@@ -6,9 +6,9 @@
"source": [
"# Order prediction tutorial\n",
"\n",
"This tutorial will guide your through predicting orders in ERP5 using an ARIMA model. The orders will be exported by ERP5 in CSV format (comma-sepparated values), and accessed and processed localy in a Jupyter Notebook.\n",
"This tutorial will guide your through predicting orders in ERP5 using an ARIMA model. The orders will be exported by ERP5 in CSV format (comma-sepparated values), and accessed and processed locally in a Jupyter Notebook.\n",
"\n",
"Please note that **Pandas** and **NumPy** can also be used inside ERP5 Wendelin software release, but Jupyter notebook adds more convenient. Soon ERP5 integration with Jupyter will be released and merged into Wendelin software release, which will make everything much easier."
"Please note that **Pandas** and **NumPy** can also be used inside ERP5 Wendelin software release, but Jupyter notebook adds more convenience. Soon ERP5 integration with Jupyter will be released and merged into Wendelin software release, which will make everything much easier."
]
},
{
......@@ -64,7 +64,7 @@
"source": [
"# Check the sample data\n",
"\n",
"Now you can go to the Sales Order Module and take a look at the generated sale orders. If you don't see any Sale Order there add a filter to see orders with the 'planned' status by writting in the first row of the table in the 'Status' column: '%planned%'. You should have something like the picture below.\n",
"Now you can go to the Sales Order Module and take a look at the generated sale orders. If you don't see any Sale Order there add a filter to see orders with the 'planned' status by writing in the first row of the table in the 'Status' column: '%planned%'. You should have something like the picture below.\n",
Please register or sign in to reply
"\n",
"![Sample data](http://img.erp5.cn/osoe-watch.sample.data-screenshot?format=png)\n",
"\n",
......@@ -77,7 +77,7 @@
"source": [
"# Extract order data from database\n",
"\n",
"In order to create a time series of orders we must create the report of the past orders to be used by the method. So we need to create a new Z SQL Method. You must go to the 'custom' folder in 'portal_skins' (`https://<your_instance_url>/portal_skins/custom/manage`), click in 'Add' and then in 'Z SQL Method'. Use 'SaleOrderModule_zGetStock' as SQL Method ID.\n",
"In order to create a time series of orders we must create the report of the past orders to be used by the method. So we need to create a new Z SQL Method. You must go to the 'custom' folder in 'portal_skins' (`https://<your_instance_url>/portal_skins/custom/manage`), click on 'Add' and then in 'Z SQL Method'. Use 'SaleOrderModule_zGetStock' as SQL Method ID.\n",
"\n",
"Then you will type the following query:\n",
"\n",
......@@ -97,7 +97,7 @@
"source": [
"# Exporting the sample data as CSV (extension)\n",
"\n",
"To export the sample data as CSV you will navigate to `https://<your_instance_url>/portal_components`, click in the 'Action' box and select 'Add Extension Component'. Use 'extension.erp5.InventoryCsv' as ID and 'InventoryCsv' as reference.\n",
"To export the sample data as CSV you will navigate to `https://<your_instance_url>/portal_components`, click on the 'Action' box and select 'Add Extension Component'. Use 'extension.erp5.InventoryCsv' as ID and 'InventoryCsv' as reference.\n",
"\n",
"Now you can copy the code below to your extension.\n",
"\n",
......@@ -127,7 +127,7 @@
"source": [
"# Exporting the sample data as CSV (external method)\n",
"\n",
"Then you will need to create an external method to call your extension and run the export code. Navigate again to the 'custom folder' inside 'portal_skins', click 'Add' and choose 'External Method'. Now choose 'getInventoryCsv' as ID, 'InventoryCsv' as 'Module Name' and 'inventory_csv' as 'Function Name'. Click 'Save changes'."
"Then you will need to create an external method to call your extension and run the exportation code. Navigate again to the 'custom' folder inside 'portal_skins', click on 'Add' and choose 'External Method'. Now choose 'getInventoryCsv' as ID, 'InventoryCsv' as 'Module Name' and 'inventory_csv' as 'Function Name'. Click on 'Save changes'."
]
},
{
......@@ -136,13 +136,13 @@
"source": [
"# Preparing Jupyter\n",
"\n",
"Now we need to install Jupyter and all the used eggs to process the data localy. Just install the packages using 'pip' as below:\n",
"Now you need to install Jupyter and all the Python libraries to process the data locally. Just install the packages using 'pip' as below:\n",
"\n",
"```sh\n",
"pip install jupyter numpy statsmodels pandas ggplot requests\n",
"pip install jupyter numpy statsmodels pandas requests\n",
"```\n",
"\n",
"When the instalation finished you should be able to start Jupyter notebook server by running `jupyter notebook`. \n",
"When the instalation is finished you should be able to start Jupyter notebook server by running `jupyter notebook`. \n",
"\n",
"Then you create a notebook called \"order prediction with ARIMA\", select \"Python 2\" as kernel and open the notebook to edit. "
]
......@@ -153,7 +153,7 @@
"source": [
"# Basic Jupyter imports and setup\n",
"\n",
"To start working with Jupyter you need a few imports and some setup first. So you activate `matploblib` inline plotting to allow Jupyter to render beautiful charts inside Jupyter. Then you import some basics modules: csv, requests (to make a request to ERP5 and get the csv data), ggplot and matplotplib (to customize and improve plots styling), pandas, the plot object from matplotlib, statsmodels' api and StringIO. See the code below."
"To start working with Jupyter you need a few imports and some setup first. So you activate `matploblib` inline plotting to allow Jupyter to render beautiful charts inside Jupyter. Then you import some basic modules: csv, requests (to make a request to ERP5 and get the csv data), matplotplib (to customize the backend), pandas, the plot object from matplotlib, statsmodels' api and StringIO. See the code below."
]
},
{
......@@ -240,7 +240,7 @@
"source": [
"# Check if series is stationary\n",
"\n",
"ARIMA models requires that the time series is stationary to give good predictions. A data series is stationary when its statiscal properties, like mean, variance, autocorrelation, and etc are all constant over time. You can check it just be looking at the plotted data, but you can also use the **Augmented Dicker-Fuller** test to have a more precise analysis. \n",
"ARIMA models requires that the time series is stationary to give good predictions. A data series is stationary when its statiscal properties, like mean, variance, autocorrelation, and etc are all constants over time. You can check this just by looking at the plotted data, but you can also use the **Augmented Dicker-Fuller** test to have a more precise analysis. \n",
"\n",
"Using the Augmented Dicker-Fuller you need to get an **adf statistic** value __smaller__ (more negative) than the critical value at 5% for regression **c** (constant), **ct** (constant and trend), **ctt** (constant and quadratic trend)."
]
......@@ -294,7 +294,7 @@
"source": [
"# Statistical analysis (auto correlation and partial auto correlation)\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 correlation graphs and make an analysis on them. 'statsmodels' provide easy to use method to plot both these graphs. Use the snippet below to do it."
"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 correlation graphs and analyse them. 'statsmodels' provide an easy to use method to plot both these graphs, check the snippet below."
]
},
{
......@@ -339,7 +339,7 @@
"source": [
"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",
"\n",
"An important thing to note is that there are mathmetical methods to have suggestion of model orders for the data. You will get to know them in the next section."
"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."
]
},
{
......@@ -348,7 +348,7 @@
"source": [
"# Minimum order sugestion for ARMA modelling\n",
"\n",
"'statsmodels' also has useful methods to give mathmetical suggestions for ARMA models order. This method can use different information criteria to make its decision. You will use the Akaike Information Criteria (aic) for this tutorial."
"'statsmodels' also has useful methods to give mathmetical suggestions for ARMA models order. This method can use different information criterias to make its decision. You will use the Akaike Information Criteria (aic) for this tutorial."
]
},
{
......@@ -416,7 +416,7 @@
"source": [
"# Fitting and checking residuals\n",
"\n",
"Now you need to check the residuals to confirm if it looks like white noise. If residuals in fact look like white noise it means your prediction is statiscally good. To do this you plot the autocorrelation and partial autocorrelation of the residuals and verify if they are under the confidence limits (blue shadow) and also wether they look like a periodic function."
"Now you need to check the residuals to confirm if it looks like white noise. If residuals in fact look like white noise it means your prediction is statiscally good. To do this you plot the autocorrelation and partial autocorrelation of the residuals and verify if they are under the confidence limits (blue shadow) and also whether they look like a periodic function."
]
},
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment