Git Product home page Git Product logo

fraud-detection's Issues

FileNotFoundError: [Errno 2] No such file or directory: 'pickle/train_data_resampled.pkl'

System: Ubuntu 16.4
User: root
Python: 2
console:
`python adasyn.py
Loading creditcard.csv
test
starting...
adasyn.py:24: DeprecationWarning:
.ix is deprecated. Please use
.loc for label based indexing or
.iloc for positional indexing

See the documentation here:
http://pandas.pydata.org/pandas-docs/stable/indexing.html#ix-indexer-is-deprecated
np.array(X_train.ix[:, X_train.columns != 'Class']),
pickling...
Traceback (most recent call last):
File "adasyn.py", line 28, in
with open('pickle/train_data_resampled.pkl', 'wb+') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'pickle/train_data_resampled.pkl'
`

Jupyter notebook project.ipynb:
In[13]:

Resample the Training Data using ADASYN

The test data remains imbalanced

#from imblearn.over_sampling import ADASYN
#ada = ADASYN()
#data_resampled, data_labels_resampled = ada.fit_sample(

np.array(X_train.ix[:, X_train.columns != 'Class']),

np.array(X_train.Class))

SLOW so will just unpickle something that was run previously

with open('pickle/train_data_resampled.pkl', 'rb') as f:
X_train_resampled = pickle.load(f)
with open('pickle/train_data_labels_resampled.pkl', 'rb') as f:
X_train_labels_resampled = pickle.load(f)

print(Counter(X_train_labels_resampled))

X_train_resampled = pd.DataFrame(X_train_resampled)
X_train_labels_resampled = pd.DataFrame(X_train_labels_resampled)
X_train_resampled = pd.concat([X_train_resampled, X_train_labels_resampled], axis=1)
X_train_resampled.columns = X_train.columns
X_train_resampled.head()

`FileNotFoundError Traceback (most recent call last)
in
8 # np.array(X_train.Class))
9 # SLOW so will just unpickle something that was run previously
---> 10 with open('pickle/train_data_resampled.pkl', 'rb') as f:
11 X_train_resampled = pickle.load(f)
12 with open('pickle/train_data_labels_resampled.pkl', 'rb') as f:

FileNotFoundError: [Errno 2] No such file or directory: 'pickle/train_data_resampled.pkl'`

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.