TransWikia.com

adding non-failure data to failure one

Data Science Asked by Ebi1990 on October 20, 2020

I have a dataset containing features of different engines showing when they failed. I want to build supervise learning model to predict whether an engine with a certain mileage is going to fail or not. Unfortunately, I have data of engines that they never fail and I need to add them to my dataset (it is true these engines never fail but they will help model to have a better view on lifetime an engine).
Could any one help me how to add these non-failure data to failure one.

Best,

One Answer

As far as I understand, you want to combine two datasets to use both for training??

If yes, you need to append one dataframe to the other. You need to make sure, that all columns/features needed for training are present in both DFs. After that you can simply append the DFs.

Python example:

>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=list('AB'))
>>> df
   A  B
0  1  2
1  3  4
>>> df2 = pd.DataFrame([[5, 6], [7, 8]], columns=list('AB'))
>>> df.append(df2)
   A  B
0  1  2
1  3  4
0  5  6
1  7  8

https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.DataFrame.append.html

Answered by Peter on October 20, 2020

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