嗨,
我使用的是標準JMP,而不是專業版...
我想建立一個下一個最好的產品類別模型。例如,如果客戶購買了產品類別A,那麼他們更有可能購買的下一個產品是什麼?我在使用的JMP版本中是否可行?我只有6個產品類別,所以不要像Market Basket Analysis那樣
你的幫助會更加受到重視,因為它非常緊急。
非常感謝
謝謝
你的數據是什麼樣的?你有每個客戶的“籃子”嗎?
我認為一個可能的簡單解決方案可能是從每個籃子開始作為一行數據。然後,您將為每個產品類別指定列:1 =已購買; 0 =未購買。
然後,這些指標變量的多變量相關性(分析>多變量方法>多變量)將告訴您哪些產品類別一起購買。
不確定最好的方法是什麼,也許是應急平台,但這裡有一個想法:
我猜你沒有足夠的數據來對每個客戶進行個性化預測,因此這個想法使用所有客戶的數據進行猜測。我用一系列購買建立了一個合成數據表,如下所示:
客戶購買數據
並提出這樣的建議:
上次購買:1建議下次購買:2
上次購買:2建議下次購買:3
上次購買:3建議下次購買:4
上次購買:4建議下次購買:5
上次購買:5建議下次購買:6
上次購買:6建議下次購買:1
totalProds = 6;
maxPurchases = 10;
totalCustomers = 1000;
_p = 1; // customers buy the next product in the sequence 10% of the time and a random product 90% ...
nextprod = Function( {}, // this is a synthetic model, just to have some data to play with
If( Random Uniform() > .90, // this is a weak relationship
_p = _p + 1;
If( _p > totalProds, _p = 1 );//
, // else
_p = Random Integer( 1, totalProds )
);
Return( _p );
);
// customers have up to maxPurchases, represented as a list of product numbers (starting at 1)
customerHistory = Function( {},
{result = {}, i},
For( i = Random Uniform( 1, maxPurchases ), i > 0, i -= 1,
Insert Into( result, nextprod() )
);
Return( result ); // {4, 5, 5, 1, 2, 4, 4, 6}
);
// make a customer table with synthetic data
dt = New Table( "Untitled",
Add Rows( totalCustomers ),
New Column( "customer", Character, "Nominal", Formula( Right( Char( 1e9 + Row() ), 8 ) ) ),
New Column( "purchases", Expression, "Nominal", Formula( customerHistory() ) ),
);
dt << runformulas; // make the table formulas ready
dt:customer << deleteformula; // and remove the formulas
dt:purchases << deleteformula; // in case the table needs sorting, etc
// record every pair of purchaces in a matrix
pairs = J( totalProds, totalProds, 0 );
For( irow = 1, irow <= N Rows( dt ), irow += 1,
p = dt:purchases[irow]; // p is a list from the data table
While( N Items( p ) >= 2, // as long as p has at least 2 items
pairs[p[1], p[2]] += 1; // use the first two as indexes to the pairs matrix
Remove From( p, 1 ); // remove the first item from p
);
);
Show( pairs ); // display the matrix
// sumarize the results
For( i = 1, i <= totalProds, i += 1,
Write( "\!nlast purchase: ", i, " suggests next purchase: ", Loc Max( pairs[i, 0] ) )
);
最後一行可能需要一些解釋:對[i,0]表示第i行,所有列。LocMax是一個返回最大值位置的函數。由於產品編號從1開始分配,因此該位置也是購買產品i後最常購買的產品編號。