こんにちは、
私はProのものではなく、標準の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] ) )
);
最後の行は少し説明が必要かもしれません:pairs [i、0]は行i、すべての列を意味します。LocMaxは最大値の位置を返す関数です。製品番号は1から割り当てられているので、その場所は製品iの購入後に最も頻繁に購入される製品番号でもあります。