A colleague has started a new ML project at /root/code/fraud-detection/, but the layout does not match the xFusionCorp Industries standard. Bring the project in line with the team's conventions.
-
Inspect the existing project at
/root/code/fraud-detection/. -
The final layout must match the tree below exactly:
fraud-detection/ ├── data/ │ ├── raw/ │ └── processed/ ├── models/ ├── notebooks/ ├── src/ │ ├── data/ │ ├── features/ │ ├── models/ │ └── utils/ ├── tests/ ├── configs/ ├── requirements.txt └── README.md -
Every subdirectory under
src/must contain an__init__.pyfile so that Python recognises it as a package. -
requirements.txtmust list the following dependencies, one per line:scikit-learn,pandas,numpy, andmlflow. The canonical PyPI name for thescikit-learnpackage isscikit-learn. -
README.mdmust begin with the heading# fraud-detection. -
Review the existing project and correct everything that does not match the requirements above.
-
Updated
Readme.mdaccording to task 5:# fraud-detection -
According to required files structures
- two sub directory
rawandprocessedis missing under data directory. testsandconfigsdirectory is also missing- let's create them using the following commands:
mkdir -p fraud-detection/data/{raw,processed} mkdir -p fraud-detection/{tests,configs} - two sub directory
-
In my case, I found two directories name was wrong (util and feature). Lets rename those directories:
mv fraud-detection/src/feature fraud-detection/src/features mv fraud-detection/src/util fraud-detection/src/utils
-
For task 3, just inspect and make sure each sub directory has
__init__.pyundersrc/directory. If anyone is missing, then you can create with these commands accordingly.touch fraud-detection/src/data/__init__.py touch fraud-detection/src/features/__init__.py touch fraud-detection/src/models/__init__.py touch fraud-detection/src/utils/__init__.py
-
Updated
requirements.txtfile based on the packages that are required to be listed.echo -e "scikit-learn\npandas\nnumpy\nmlflow" > fraud-detection/requirements.txt