Posts

MeanNearestNeighbors (MNN) - algorithm for balancing dataset - In progress #1

Image
One of the challenges in classification problems are unbalanced datasets. I was Data Science Intern when the company that I worked for, assigned me such an interesting challenge where the dataset was unbalanced.  However, I realized this type of problem like unbalanced dataset is а common thing in real life. I tried most of the algorithms (undersampling, oversampling) like SMOTE, NearMiss, CondensedNearestNeighbors, RandomUnderSampler, RandomOverSampler,  KMeansSMOTŠ• and rest of them. Anyway, they didn't help me in that case, on the contrary, they worsened my model.  I was like: "but, but, you should have been helpful in creating the predictive model" So, I'm trying to create another algorithm based on undersampling concept when it comes to balancing datasets. I called it Mean Nearest Neighbors (MNN). What's the initial idea: It's simple. Actually, the algorithm is just a modification of the other undersampling algorithms. In the data where target labe...

IDEAL ENVIRONMENT FOR PROGRAMMERS

Image
Programming is a challenging activity. The last thing you need is bad surrounding to make the experience distasteful. The niceness of the environment in which you work in goes a long way to  increase productivity , makes the task less strenuous and also guarantee overall good health. There is no approved standard for what a programming environment should look like. Programming can be done from anywhere, as long as there’s a workable computer at hand. This doesn’t mean the environment should be ignored. A great programming environment should have: 1. Space Don’t be satisfied with a small desk which can only fit your computer and nothing else. You need desk space. Maybe for the pen and notepad, you should keep next to your computer for writing down stuff. Coding involves a lot of typing. As such, the wrist should be supported and line up with the keyboard. A small desk with no space for the wrists will put stress on this part of the body. The uncomfortable pains which follow w...

Top 10 technologies to learn in 2018 >

Image

5 Principles of Programming that Every Coder Must Know

Image
Below are some of the useful principles of programming that you must keep in mind while writing code. 1. Simplicity Simplicity is the ultimate sophistication and perhaps nowhere more than in programming. It all begins with how you document and dissect program requirements. Each requirement should be well articulated to the extent that once you start to code, you can satisfy these requirements using the simplest of techniques. Complex code not only takes more time to design and write but is also more vulnerable to errors and bugs. A labyrinth of code can make  web app monitoring  tedious. Beware of feature creep where you start to add new features to the program that the customer didn’t ask for as this only needlessly entangles the software. 2. Do Not Repeat Yourself Minimal repetition is a sign of quality code. Avoid duplicating logic and data. To know whether your program has excessive repetition, think about how much code you’d need to modify if you wanted to alte...

Competitive Programming #28 : [Divisor Product]

Victor is playing with divisors of a number N. He is curious about the product of all these divisors. Given a number N, help him find the product of all the divisors of N (including N). Since the products can be large, print the answer modulo (10^9 + 7). Input :  First line of input contains a single integer T denoting the number of test cases. The only line of each test case contains an integer N. Output :  For each test case, print the required answer in a new line. Constraints :  1 <= T <= 200 1 <= N <= 10^9 Example : Input :  3 6 9 12 Output :  36 27 1728 Explanation : Case 1 :  Divisors of 6 : 1, 2, 3, 6 Product = 1*2*3*6 = 36 Case 2 :  Divisors of 9 : 1, 3, 9 Product = 1*3*9 = 27 Case 3 :  Divisors of 12 : 1, 2, 3, 4, 6, 12 Product = 1*2*3*4*6*12 = 1728 Solution: ------------------------------------    Since N takes large values, brute force won't work. So let's do mat...