Split text (input) and team (answer) with train_test_split (test_size=0.25, random_state=42, stratify on team).
For alpha in [0.01, 1, 10], train make_pipeline(CountVectorizer(), MultinomialNB(alpha=a)) and store a dict from alpha to test accuracy, rounded to 3 decimals, in result.
import io
import pandas as pd
tickets = pd.read_csv(io.StringIO("""ticket_id,text,team
5001,"How do I upgrade my plan to 200 Mbps?",Account
5002,"After the plan upgrade the speed is still the same",Technical
5003,"Please send the invoice for April, I need it for office",Billing
5004,"I paid the bill but the internet is still not working",Technical
5005,"I was charged twice for the April bill, please refund",Billing
5006,"Plan shows 100 Mbps in the app but I get less",Technical
5007,"Please update my email id on the account",Account
5008,"Why is my bill higher this month? I did not change my plan",Billing
5009,"Please check my connection and my bill",Technical
5010,"Wifi keeps disconnecting every few minutes",Technical
5011,"Need help with my account, internet not working",Technical
5012,"Cannot connect to wifi after the power cut",Technical
5013,"Router light is red and there is no internet",Technical
5014,"Add my wife as a second contact on the account",Account
5015,"I was charged twice for the May bill, please refund",Billing
5016,"Wifi keeps disconnecting every few minutes",Technical
5017,"Auto pay is not working, the bill is still showing due",Billing
5018,"Wifi keeps disconnecting every few minutes",Technical
5019,"Internet down in the whole building, please check",Technical
5020,"Wifi keeps disconnecting every few minutes",Technical
5021,"I paid the bill but the internet is still not working",Technical
5022,"Cannot connect to wifi after the power cut",Technical
5023,"Please check my connection and my bill",Technical
5024,"Internet was cut because my payment did not go through, please check",Billing
5025,"Internet down in the whole building, please check",Technical
5026,"Late fee added even though I paid the bill on time",Billing
5027,"I want to shift my connection to a new address",Account
5028,"Auto pay is not working, the bill is still showing due",Billing
5029,"Video calls keep freezing, the connection is not stable",Technical
5030,"Internet down in the whole building, please check",Technical
5031,"Router light is red and there is no internet",Technical
5032,"Add my wife as a second contact on the account",Account
5033,"Payment failed but money was deducted from my account",Billing
5034,"After the plan upgrade the speed is still the same",Technical
5035,"Internet is slow so I want to change to a bigger plan",Account
5036,"I paid the bill but the internet is still not working",Technical
5037,"I paid the bill but the internet is still not working",Technical
5038,"Cannot connect to wifi after the power cut",Technical
5039,"Please change the name on the bill to my name",Account
5040,"Internet is slow so I want to change to a bigger plan",Account
5041,"Cannot connect to wifi after the power cut",Technical
5042,"Please change the name on the bill to my name",Account
5043,"Wifi keeps disconnecting every few minutes",Technical
5044,"Internet down in the whole building, please check",Technical
5045,"Router light is red and there is no internet",Technical
5046,"Internet down in the whole building, please check",Technical
5047,"Internet is slow so I want to change to a bigger plan",Account
5048,"Please send the invoice for May, I need it for office",Billing
5049,"Speed test shows only 20 Mbps on a 100 Mbps plan",Technical
5050,"After the plan upgrade the speed is still the same",Technical
5051,"Late fee added even though I paid the bill on time",Billing
5052,"Refund for the cancelled plan is still not received",Billing
5053,"Plan shows 100 Mbps in the app but I get less",Account
5054,"Speed test shows only 10 Mbps on a 100 Mbps plan",Technical
5055,"Please send the invoice for April, I need it for office",Billing
5056,"Late fee added even though I paid the bill on time",Billing
5057,"Video calls keep freezing, the connection is not stable",Technical
5058,"Please change the registered mobile number on my account",Account
5059,"I paid the bill but the internet is still not working",Technical
5060,"Plan shows 100 Mbps in the app but I get less",Technical
5061,"Please send the invoice for June, I need it for office",Billing
5062,"Internet down in the whole building, please check",Technical
5063,"Router light is red and there is no internet",Technical
5064,"Internet was cut because my payment did not go through, please check",Billing
5065,"Internet is very slow since morning",Technical
5066,"Internet was cut because my payment did not go through, please check",Billing
5067,"Cannot connect to wifi after the power cut",Technical
5068,"I was charged twice for the March bill, please refund",Billing
5069,"Internet is slow so I want to change to a bigger plan",Account
5070,"Please update my email id on the account",Account
5071,"Internet is slow so I want to change to a bigger plan",Account
5072,"Why is my bill higher this month? I did not change my plan",Billing
5073,"Need help with my account, internet not working",Technical
5074,"Refund for the cancelled plan is still not received",Billing
5075,"Please check my connection and my bill",Technical
5076,"Plan shows 100 Mbps in the app but I get less",Account
5077,"Why is my bill higher this month? I did not change my plan",Billing
5078,"Internet was cut because my payment did not go through, please check",Billing
5079,"I am paying for 100 Mbps but the bill shows a different plan",Billing
5080,"Internet is very slow since two days",Technical
5081,"Auto pay is not working, the bill is still showing due",Billing
5082,"Payment failed but money was deducted from my account",Billing
5083,"Internet is very slow since yesterday",Technical
5084,"Late fee added even though I paid the bill on time",Billing
5085,"Internet down in the whole building, please check",Technical
5086,"Internet is very slow since two days",Technical
5087,"Internet was cut because my payment did not go through, please check",Billing
5088,"Refund for the cancelled plan is still not received",Billing
5089,"Wifi keeps disconnecting every few minutes",Technical
5090,"I want to shift my connection to a new address",Account
5091,"How do I upgrade my plan to 300 Mbps?",Account
5092,"After the plan upgrade the speed is still the same",Technical
5093,"Speed test shows only 10 Mbps on a 100 Mbps plan",Technical
5094,"Auto pay is not working, the bill is still showing due",Billing
5095,"I paid the bill but the internet is still not working",Technical
5096,"Need help with my account, internet not working",Account
5097,"Internet down in the whole building, please check",Technical
5098,"Wifi keeps disconnecting every few minutes",Technical
5099,"Internet is very slow since yesterday",Technical
5100,"Internet down in the whole building, please check",Technical
5101,"Please send the invoice for March, I need it for office",Billing
5102,"Video calls keep freezing, the connection is not stable",Technical
5103,"Cannot connect to wifi after the power cut",Technical
5104,"Refund for the cancelled plan is still not received",Billing
5105,"Please send the invoice for April, I need it for office",Billing
5106,"Need help with my account, internet not working",Technical
5107,"Late fee added even though I paid the bill on time",Billing
5108,"Auto pay is not working, the bill is still showing due",Billing
5109,"Wifi keeps disconnecting every few minutes",Technical
5110,"Please check my connection and my bill",Billing
5111,"Internet is slow so I want to change to a bigger plan",Account
5112,"I forgot the password for the customer app",Account
5113,"I was charged twice for the June bill, please refund",Billing
5114,"Please check my connection and my bill",Billing
5115,"How do I upgrade my plan to 500 Mbps?",Account
5116,"Wifi keeps disconnecting every few minutes",Technical
5117,"Auto pay is not working, the bill is still showing due",Billing
5118,"Why is my bill higher this month? I did not change my plan",Billing
5119,"Payment done for the new plan, please activate",Account
5120,"Router light is red and there is no internet",Technical
5121,"Not happy with the service, please call me",Account
5122,"Internet is very slow since two days",Technical
5123,"Video calls keep freezing, the connection is not stable",Technical
5124,"Not happy with the service, please call me",Technical
5125,"How do I upgrade my plan to 200 Mbps?",Account
5126,"Router light is red and there is no internet",Technical
5127,"I am paying for 100 Mbps but the bill shows a different plan",Billing
5128,"Please check my connection and my bill",Billing
5129,"Not happy with the service, please call me",Billing
5130,"Cannot connect to wifi after the power cut",Technical
5131,"Speed test shows only 5 Mbps on a 100 Mbps plan",Technical
5132,"I paid the bill but the internet is still not working",Technical
5133,"Payment done for the new plan, please activate",Billing
5134,"How do I upgrade my plan to 500 Mbps?",Account
5135,"I was charged twice for the June bill, please refund",Billing
5136,"Wifi keeps disconnecting every few minutes",Technical
5137,"Internet down in the whole building, please check",Technical
5138,"Wifi keeps disconnecting every few minutes",Technical
5139,"Payment failed but money was deducted from my account",Billing
5140,"Speed test shows only 20 Mbps on a 100 Mbps plan",Technical
5141,"Internet down in the whole building, please check",Technical
5142,"Internet was cut because my payment did not go through, please check",Billing
5143,"Video calls keep freezing, the connection is not stable",Technical
5144,"Internet down in the whole building, please check",Technical
5145,"Why is my bill higher this month? I did not change my plan",Billing
5146,"Internet down in the whole building, please check",Technical
5147,"Internet is very slow since two days",Technical
5148,"Internet was cut because my payment did not go through, please check",Billing
5149,"Add my wife as a second contact on the account",Account
5150,"Late fee added even though I paid the bill on time",Billing
5151,"I paid the bill but the internet is still not working",Technical
5152,"I am paying for 100 Mbps but the bill shows a different plan",Billing
5153,"Speed test shows only 10 Mbps on a 100 Mbps plan",Technical
5154,"Not happy with the service, please call me",Technical
5155,"I want to shift my connection to a new address",Account
5156,"Internet down in the whole building, please check",Technical
5157,"Please change the registered mobile number on my account",Account
5158,"Auto pay is not working, the bill is still showing due",Billing
5159,"Video calls keep freezing, the connection is not stable",Technical
5160,"Refund for the cancelled plan is still not received",Billing
5161,"After the plan upgrade the speed is still the same",Technical
5162,"Refund for the cancelled plan is still not received",Billing
5163,"Please send the invoice for May, I need it for office",Billing
5164,"Cannot connect to wifi after the power cut",Technical
5165,"I am paying for 100 Mbps but the bill shows a different plan",Billing
5166,"Speed test shows only 20 Mbps on a 100 Mbps plan",Technical
5167,"Internet down in the whole building, please check",Technical
5168,"Late fee added even though I paid the bill on time",Billing
5169,"Cannot connect to wifi after the power cut",Technical
5170,"Internet down in the whole building, please check",Technical
5171,"How do I upgrade my plan to 500 Mbps?",Account
5172,"Please check my connection and my bill",Technical
5173,"Please change the name on the bill to my name",Account
5174,"Internet down in the whole building, please check",Technical
5175,"Wifi keeps disconnecting every few minutes",Technical
5176,"Please update my email id on the account",Account
5177,"Late fee added even though I paid the bill on time",Billing
5178,"Internet was cut because my payment did not go through, please check",Billing
5179,"Refund for the cancelled plan is still not received",Billing
5180,"I paid the bill but the internet is still not working",Technical
5181,"Internet was cut because my payment did not go through, please check",Billing
5182,"Internet is very slow since morning",Technical
5183,"Late fee added even though I paid the bill on time",Billing
5184,"Need help with my account, internet not working",Account
5185,"Payment failed but money was deducted from my account",Billing
5186,"Payment done for the new plan, please activate",Billing
5187,"Refund for the cancelled plan is still not received",Billing
5188,"Speed test shows only 10 Mbps on a 100 Mbps plan",Technical
5189,"Speed test shows only 20 Mbps on a 100 Mbps plan",Technical
5190,"Please update my email id on the account",Account
5191,"After the plan upgrade the speed is still the same",Technical
5192,"Cannot connect to wifi after the power cut",Technical
5193,"Cannot connect to wifi after the power cut",Technical
5194,"Plan shows 100 Mbps in the app but I get less",Technical
5195,"Refund for the cancelled plan is still not received",Billing
5196,"Add my wife as a second contact on the account",Account
5197,"Please check my connection and my bill",Technical
5198,"Speed test shows only 5 Mbps on a 100 Mbps plan",Technical
5199,"Need help with my account, internet not working",Account
5200,"Cannot connect to wifi after the power cut",Technical
5201,"Wifi keeps disconnecting every few minutes",Technical
5202,"Router light is red and there is no internet",Technical
5203,"I am paying for 100 Mbps but the bill shows a different plan",Billing
5204,"Wifi keeps disconnecting every few minutes",Technical
5205,"Plan shows 100 Mbps in the app but I get less",Technical
5206,"Payment done for the new plan, please activate",Account
5207,"Please check my connection and my bill",Billing
5208,"Not happy with the service, please call me",Account
5209,"I was charged twice for the June bill, please refund",Billing
5210,"Cannot connect to wifi after the power cut",Technical"""))Store your final answer in a variable named result.
Each hint gives a little more help. Try on your own first.
Run your code to see the output here.