diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..d09887d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,10 @@ +# Changelog + +## [1.0.0] - 2023-10-27 +### Added +- Nueva rama `feature/salary-prediction`. +- Endpoint de API `/api/predict` que devuelve JSON. +- Archivo de pruebas `test_app.py`. + +### Changed +- Se actualizó la interfaz de usuario para mejorar la experiencia. \ No newline at end of file diff --git a/README1.md b/README1.md new file mode 100644 index 0000000..2f38958 --- /dev/null +++ b/README1.md @@ -0,0 +1,12 @@ +# Predicción de Salarios - ML Flask App + +## Descripción +Esta aplicación utiliza un modelo de Machine Learning para predecir el salario de un empleado basado en sus años de experiencia y habilidades. + +## Instalación +1. Clonar el repo. +2. Crear entorno virtual: `python -m venv venv`. +3. Instalar dependencias: `pip install -r requirements.txt`. + +## Cómo usar +Ejecuta `python app.py` y abre `http://localhost:5000` en tu navegador. \ No newline at end of file diff --git a/__pycache__/app.cpython-313.pyc b/__pycache__/app.cpython-313.pyc new file mode 100644 index 0000000..a3f10aa Binary files /dev/null and b/__pycache__/app.cpython-313.pyc differ diff --git a/__pycache__/application.cpython-313.pyc b/__pycache__/application.cpython-313.pyc new file mode 100644 index 0000000..8b71c26 Binary files /dev/null and b/__pycache__/application.cpython-313.pyc differ diff --git a/__pycache__/test_app.cpython-313-pytest-8.3.4.pyc b/__pycache__/test_app.cpython-313-pytest-8.3.4.pyc new file mode 100644 index 0000000..6cab62a Binary files /dev/null and b/__pycache__/test_app.cpython-313-pytest-8.3.4.pyc differ diff --git a/application.py b/application.py index ca52f60..37c6903 100644 --- a/application.py +++ b/application.py @@ -2,6 +2,14 @@ from flask import Flask, request, jsonify, render_template import pickle +######################################################### +import sys +import sklearn.linear_model._base as s_base +sys.modules['sklearn.linear_model.base'] = s_base + +import pickle +########################################################## + application = Flask(__name__) #Initialize the flask App model = pickle.load(open('model.pkl', 'rb')) diff --git a/test.py b/test.py new file mode 100644 index 0000000..aa90cbd --- /dev/null +++ b/test.py @@ -0,0 +1,3 @@ +def test_home_status_code(client): + response = client.get('/') + assert response.status_code == 200 \ No newline at end of file