write a python finction

In Progress Posted 5 years ago Paid on delivery
In Progress Paid on delivery

The problem was that a certain dataset was very skewed and had many many more instances of good loans than bad loans (<5%) and the objective was to predict bad loans.

Implement a generic function (that would work on any such dataset) with comments that takes n splits from the dataset such that each split is unique and contains an almost equal number of bad loans (target=0) and good loans (target=1)

1) implement such a function that takes a csv and outputs several dataframes (for example 10 folds), each of which is a unique split with equal amounts of good and bad loans?

2) The rare class (target =1) (bad loans) can be reused but the abundant class must be unique in all splits (no row should be used more than once)

3) The size of each split should be random

ie suppose we have 800,000 loans where 40,000 are bad loans and 760,000 are good loans. We can make 10 different splits with equal number of good and bad for example: split 1, bad = 20,000 good = 22,000. Split 2 another 10,000 bad loans and like 10,555 good loans. Split 3: Good = 40,000 Bad=40,000 ….

You can use the following dataset:

[login to view URL]

Database Programming PHP Programming Python Software Development

Project ID: #17647804

About the project

14 proposals Remote project Active 5 years ago

Awarded to:

Techiedev

I have good experiences developing code in Python Programming language for scientific computing , data science and machine learning. I think your task can be done easily with using numpy packages especially random met More

€19 EUR in 1 day
(32 Reviews)
4.9

14 freelancers are bidding on average €52 for this job

LiveExperts

.................................................................................................................................................

€444 EUR in 1 day
(57 Reviews)
7.4
damilareisaac

Hi there, I have read the project description. I will be looking forward to work with you on this project. Please contact me on PM for details.

€30 EUR in 1 day
(52 Reviews)
6.1
DarkKnight2206

Hello!\nI am a python developer.\nI looked at your project and it seems interesting.\nI have all necessary skills required for this project.\nPing me to discuss in detail.

€30 EUR in 2 days
(39 Reviews)
5.6
pkouzouglidis

Hello, i have finished the function. I implemented a function named get_next_split(class_size) where you put as an argument the size of each class that you want for the next split. They it returns a dataframe containin More

€20 EUR in 1 day
(28 Reviews)
4.1
Ashw1nBhat

I have been doing machine learning for two years and this is an easy project i can complete in one day. I asked for three days just so i can test the code. Otherwose it is easy

€24 EUR in 3 days
(3 Reviews)
2.7
dangphap

Hello, I am a Python programmer with data science background. I could write code in Python that implement random module to select the sample as your requirements. Please pm me for further discussion. Thank you!

€19 EUR in 2 days
(4 Reviews)
2.1
AssistSW

I am very much interested in doing job. I can do this for you very quickly. Please let me know. I have 3 years of python experience.

€29 EUR in 1 day
(1 Review)
1.7
alimirzavw

Hi, I actually dealt with a similar problem you describe. Have you tried considering stratified k-fold splitting? Its practically the same thing you are asking. Plus if you plan to use a model for training do def More

€29 EUR in 2 days
(0 Reviews)
0.0
korolvl

MSc in Statistics at London School of Economics with good programming skills and knowledge of predictive modelling.

€12 EUR in 2 days
(0 Reviews)
0.0
rushabhsudame

Hello SIr, I am a Professional Python Developer. I think I can help you with this project. Let me know if you are interested so that we can discuss further about the project. Thank You.

€23 EUR in 1 day
(0 Reviews)
1.0