1
$\begingroup$

I have to write a binary classifier for my company that should be as simple as possible and doesn't use machine learning libraries (and I also should not code too sophisticated algorithms by myself).

I just came up with the following idea: If I used a boxplot of my features and if the feature value of a new sample is bigger than the whiskers of the boxplot, I say the sample is in category A and if it is smaller than the whisker, it is in category B. Is this a good approach? (probably not) Are there classification algorithms that are simple enough so that it is feasible to code them without libraries?

$\endgroup$
  • $\begingroup$ Can you describe your dataset please? These problems depend heavily on the type of distributions you are working with. $\endgroup$ – JahKnows Oct 20 '18 at 20:02
  • $\begingroup$ @JahKnows Hi Jah. I evaluate bank account statements. My task is to classify an account holder as a private person or as a company by the turnovers in the account statement. My boss' approach so far was to search for keywords (e.g. "salary" or specific types of taxes that have only be payed by companies) . I am doing this too but the recall of such simple string search rules is very small (and it is extremely tedious, but thats a different problem I guess). As you can imagine, the dataset contains a lot of outliers (e.g. very rich people, or high expenditures when someone buys a car) $\endgroup$ – maxE Oct 21 '18 at 11:21
1
$\begingroup$

How about implementing one of the most basic binary classifiers by hand without any libraries, Logistic Regression? Here is the explanation of the Logistic Regression in subtle terms:

https://www.youtube.com/watch?v=6tByJTacCOc&index=6&list=PLBAGcD3siRDguyYYzhVwZ3tLvOyyG5k6K

Here is the description of writing a simplified version of a binary classifier in Python, which will take a few buckets of lines in the vectorized form:

https://www.youtube.com/watch?v=ERIFzbTdIm0&index=14&list=PLBAGcD3siRDguyYYzhVwZ3tLvOyyG5k6K

If you feel uncomfortable with the implementation or confused about something, I'm sure that if you watch the videos in between the two that I provide, you will be able to easily write the algorithm that the video describes. I hope I could help; if you are not happy with the offered solution, I will be around for alternatives. Have fun.

| improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.