Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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.
12 changes: 12 additions & 0 deletions README1.md
Original file line number Diff line number Diff line change
@@ -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.
Binary file added __pycache__/app.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/application.cpython-313.pyc
Binary file not shown.
Binary file added __pycache__/test_app.cpython-313-pytest-8.3.4.pyc
Binary file not shown.
8 changes: 8 additions & 0 deletions application.py
Original file line number Diff line number Diff line change
Expand Up @@ -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'))

Expand Down
3 changes: 3 additions & 0 deletions test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
def test_home_status_code(client):
response = client.get('/')
assert response.status_code == 200