Am very new to machine learning, and alogirithms. Am learning the various ml concepts, so please excuse for my ignorance.
I am working on a project, wherein I need to make a prediction for sales rep calls to be made for the future quarter, based on the rep_calls in the last historic data. Am providing herewith a sample dataframe for your reference and to provide suggestions please.
The rep_calls prediction for QTR4, should be based on the rep calls for the CUSTOMER_NUMBER & PRODUCT_ID, that is available for the last 3 quarter.
df = pd.DataFrame({"CUSTOMER_NUMBER": ["CUST1", "CUST1", "CUST1", "CUST1", "CUST1", "CUST1", "CUST1", "CUST1", "CUST1", "CUST2", "CUST2", "CUST2", "CUST2", "CUST2", "CUST2", "CUST2", "CUST3", "CUST3", "CUST3", "CUST4", "CUST4", "CUST4"],
"PRODUCT": ["PRODUCT1", "PRODUCT2", "PRODUCT3", "PRODUCT1", "PRODUCT2", "PRODUCT3", "PRODUCT1", "PRODUCT2", "PRODUCT3", "PRODUCT1", "PRODUCT2", "PRODUCT3", "PRODUCT1", "PRODUCT2", "PRODUCT3", "PRODUCT3", "PRODUCT3", "PRODUCT3", "PRODUCT3", "PRODUCT1", "PRODUCT1", "PRODUCT2"],
"REP_VISITS": ["3", "3", "3", "3", "3", "3", "4", "4", "4", "3", "2", "2", "4", "6", "8", "5", "3", "1", "3", "2", "0", "3"],
"QTR": ["QTR1", "QTR1", "QTR1", "QTR2", "QTR2", "QTR2", "QTR3", "QTR3", "QTR3", "QTR1", "QTR1", "QTR1", "QTR2", "QTR2", "QTR2", "QTR3", "QTR1", "QTR2", "QTR3", "QTR1", "QTR2", "QTR3"],
"START_DATE": ["2020-01-01", "2020-01-01", "2020-01-01", "2020-04-01", "2020-04-01", "2020-04-01", "2020-07-01", "2020-07-01", "2020-07-01", "2020-01-01", "2020-01-01", "2020-01-01", "2020-04-01", "2020-04-01", "2020-04-01","2020-07-01", "2020-01-01", "2020-04-01", "2020-07-01", "2020-01-01", "2020-04-01", "2020-07-01"],
"END_DATE": ["2020-03-31", "2020-03-31", "2020-03-31", "2020-06-30", "2020-06-30", "2020-06-30", "2020-09-30", "2020-09-30", "2020-09-30", "2020-03-31", "2020-03-31", "2020-03-31", "2020-06-30", "2020-06-30", "2020-06-30", "2020-09-30", "2020-03-31", "2020-06-30", "2020-09-30", "2020-03-31", "2020-06-30", "2020-09-30"]})
The dataframe looks as below:
I need to find out the predicted rep_calls for QTR4.
CUST1|PRODUCT1||QTR4|
CUST1|PRODUCT2||QTR4|
CUST1|PRODUCT3||QTR4|
CUST2|PRODUCT1||QTR4|
CUST2|PRODUCT2||QTR4|
CUST2|PRODUCT3||QTR4|
CUST3|PRODUCT3||QTR4|
CUST4|PRODUCT1||QTR4|
CUST4|PRODUCT2||QTR4|
Please guide me how i can create training dataset for customers/products, with appopriate predictions, so i can use the test_data for predictions/valuations.
question from:
https://stackoverflow.com/questions/65917724/to-make-group-by-predictions-using-test-train-data-group-by-multiple-columns