oneapi-src / credit-card-fraud-detection

AI Starter Kit for Credit Card Fraud Detection model using Intel® Extension for Scikit-learn*
BSD 3-Clause "New" or "Revised" License
1 stars 0 forks source link

pandas warnings #4

Open bconsolvo opened 1 year ago

bconsolvo commented 1 year ago

When running the training

python ./src/run_benchmarks_train.py -l ./logs/stock_training.
log

I am getting some warnings for pandas:

/home/u151382/Consolvo/20221027_creditcardfraud/credit-card-fraud-detection/src/utils/training.py:33: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  data_for_clustering['Clusters'] = db.labels_
/home/u151382/Consolvo/20221027_creditcardfraud/credit-card-fraud-detection/src/utils/data_processing.py:15: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df_clusters['Class'] = y_train
Selecting following clusters which has most positive classes:  -1
bconsolvo commented 1 year ago

Same warning when running in the Intel environment:

Intel(R) Extension for Scikit-learn* enabled (https://github.com/intel/scikit-learn-intelex)
/home/u151382/Consolvo/20221027_creditcardfraud/credit-card-fraud-detection/src/utils/training.py:33: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  data_for_clustering['Clusters'] = db.labels_
/home/u151382/Consolvo/20221027_creditcardfraud/credit-card-fraud-detection/src/utils/data_processing.py:15: SettingWithCopyWarning: 
A value is trying to be set on a copy of a slice from a DataFrame.
Try using .loc[row_indexer,col_indexer] = value instead

See the caveats in the documentation: https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html#returning-a-view-versus-a-copy
  df_clusters['Class'] = y_train
Selecting following clusters which has most positive classes:  -1