Skip to content

Instantly share code, notes, and snippets.

@tidjungs
Created April 27, 2017 13:58
Show Gist options
  • Select an option

  • Save tidjungs/3a1d23125e1d00502f73c94b98a1906d to your computer and use it in GitHub Desktop.

Select an option

Save tidjungs/3a1d23125e1d00502f73c94b98a1906d to your computer and use it in GitHub Desktop.
// avg graph and moving avg
// send product_id
{
// ใช้ plot graph avg
data: [
{ id: 1, time: , farm1: 2000, farm2: 1000, farm3: 4000, type: 1week | 1month | 1 year | 2 year | 5 year }
{ id: 2, time: , farm1: 3000, farm2: 5000, farm3: 4000, type: 1week | 1month | 1 year | 2 year | 5 year }
],
// ใช้ แสดง moving avg
farms: [
{
id: farm_id,
name: ‘farm1’,
moving_average_week: ,
moving_average_month:,
moving_average_year: ,
moving_average_two_years: ,
moving_average_five_years: ,
},
{
id: farm_id,
name: ‘farm2’,
moving_average_week: ,
moving_average_month:,
moving_average_year: ,
moving_average_two_years: ,
moving_average_five_years: ,
},
{
id: farm_id,
name: ‘farm3’,
moving_average_week: ,
moving_average_month:,
moving_average_year: ,
moving_average_two_years: ,
moving_average_five_years: ,
}
]
}
// corelation
// send 2 product_id
{
data: [
{
id: 1,
type: 1week | 1month | 1 year | 2 year | 5 year
product_price1: $100,
product_price2: $20
}
]
// ส่งค่า corlelation ที่คำนวณมา
correlations_value: 0.9
correlatiobns_type: 'positive corelation'
// type ดูเว็บนี้มั้ง https://www.mathsisfun.com/data/correlation.html
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment