TransWikia.com

How to Define a Cost Fucntion?

Data Science Asked by Vaibhav Thakur on April 5, 2021

I want to define a cost function in python to identify optimum value in days when i should end a marketing campaign to save spend on campaigns not generating traffic good traffic.
Problem is I dont have any idea where to start not even sure what kind of data i should collect to make a cost function.
Please share how to proceed in this case. I understand the point after defining cost function gradient descent can be used to find , but i have no idea how to define such a cost function.

One Answer

well there are two things.

  1. You write your learning algorithm from scratch. Then you define your cost function yourself. No one usually does that unless they are asked for.
  2. Using Machine Learning libraries in Python (Most common is SKlearn unless you want to use Neural Networks in e.g. Keras). They have their own cost functions designed. You just need to define your problem properly then it does the thing for you.

In (2) just define your problem properly. The question is fuzzy (what does "not generating traffic good traffic" mean?) but you input your data to your algorithm and it optimize the cost function according to the chosen algorithm. If you need more input, please update the question and give more details so I can help.

Answered by Kasra Manshaei on April 5, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP