Skip to content

Commit

Permalink
ML setup
Browse files Browse the repository at this point in the history
  • Loading branch information
viviannnl committed Sep 10, 2023
1 parent 7ce4a9f commit 22f5ce7
Show file tree
Hide file tree
Showing 20 changed files with 105 additions and 0 deletions.
8 changes: 8 additions & 0 deletions CarAIbou_full.egg-info/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
Metadata-Version: 2.1
Name: CarAIbou-full
Version: 0.0.1
Author: Vivian
Author-email: [email protected]
Requires-Dist: pandas
Requires-Dist: numpy
Requires-Dist: seaborn
7 changes: 7 additions & 0 deletions CarAIbou_full.egg-info/SOURCES.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
setup.py
CarAIbou_full.egg-info/PKG-INFO
CarAIbou_full.egg-info/SOURCES.txt
CarAIbou_full.egg-info/dependency_links.txt
CarAIbou_full.egg-info/requires.txt
CarAIbou_full.egg-info/top_level.txt
src/__init__.py
1 change: 1 addition & 0 deletions CarAIbou_full.egg-info/dependency_links.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

3 changes: 3 additions & 0 deletions CarAIbou_full.egg-info/requires.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pandas
numpy
seaborn
1 change: 1 addition & 0 deletions CarAIbou_full.egg-info/top_level.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
src
1 change: 1 addition & 0 deletions logs/09_09_2023_22_51_37.log/09_09_2023_22_51_37.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ 2023-09-09 22:51:37,891 ] 18 root - INFO - Logging has started
1 change: 1 addition & 0 deletions logs/09_09_2023_22_59_58.log/09_09_2023_22_59_58.log
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[ 2023-09-09 22:59:58,854 ] 26 root - INFO - Logging Exceptions: Divide on zero error
4 changes: 4 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pandas
numpy
seaborn
-e .
31 changes: 31 additions & 0 deletions setup.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# to build our application as a package

from setuptools import find_packages, setup
from typing import List


HYPHEN_E_DOT = '-e .'
def get_requirements(file_path:str)->List[str]:
'''
This funciton will return the list of requirements
'''
requirements = []
with open(file_path) as file_obj:
requirements=file_obj.readlines()
requirements = [req.replace("\n", "") for req in requirements]

if HYPHEN_E_DOT in requirements:
requirements.remove(HYPHEN_E_DOT)

return requirements


setup(
name='CarAIbou_full',
version='0.0.1',
author='Vivian',
author_email='[email protected]',
packages=find_packages(),
install_requires=get_requirements('requirements.txt')

)
Empty file added src/__init__.py
Empty file.
Empty file added src/components/__init__.py
Empty file.
Empty file.
Empty file.
Empty file added src/components/model_trainer.py
Empty file.
28 changes: 28 additions & 0 deletions src/exception.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import sys
from src.logger import logging

def error_message_detail(error, error_detail:sys):
_,_,exc_tb = error_detail.exc_info() #which file and line the exception occurs
file_name = exc_tb.tb_frame.f_code.co_filename

error_message = "Error occured in python script name [{0}] line number [{1}] error message[{2}]".format(
file_name, exc_tb.tb_lineno,str(error)
)
return error_message

class CustomException(Exception):
def __init__(self, error_message, error_detail:sys):
super().__init__(error_message)
self.error_message = error_message_detail(error_message, error_detail=error_detail)

def __str__(self):
return self.error_message

'''
if __name__ == "__main__":
try:
a = 1/0
except Exception as e:
logging.info("Logging Exceptions: Divide on zero error")
raise CustomException(e, sys)
'''
20 changes: 20 additions & 0 deletions src/logger.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import logging
import os
from datetime import datetime

LOG_FILE = f"{datetime.now().strftime('%m_%d_%Y_%H_%M_%S')}.log"
logs_path = os.path.join(os.getcwd(), "logs",LOG_FILE)
os.makedirs(logs_path, exist_ok=True)

LOG_FILE_PATH = os.path.join(logs_path, LOG_FILE)

logging.basicConfig(
filename=LOG_FILE_PATH,
format = "[ %(asctime)s ] %(lineno)d %(name)s - %(levelname)s - %(message)s",
level=logging.INFO,
)

'''
if __name__ == "__main__":
logging.info("Logging has started")
'''
Empty file added src/pipeline/__init__.py
Empty file.
Empty file.
Empty file added src/pipeline/train_pipeline.py
Empty file.
Empty file added src/utils.py
Empty file.

0 comments on commit 22f5ce7

Please sign in to comment.