Skip to content

Instantly share code, notes, and snippets.

View MarwanDebbiche's full-sized avatar
🎧
Having fun, as always.

Marwan Debbiche MarwanDebbiche

🎧
Having fun, as always.
  • Paris, FR
View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@MarwanDebbiche
MarwanDebbiche / flask-iris-classifier-api.py
Created August 8, 2019 16:34
Flask Iris Classifier API
from flask import Flask
from flask import request
import joblib
import pandas as pd
import json
with open("iris_classifier.joblib", "rb") as f:
iris_classifier = joblib.load(f)
@MarwanDebbiche
MarwanDebbiche / flask-iris-classifier-api-second-part.py
Created August 8, 2019 16:37
Flask Iris Classifier API - Second Part
@app.route('/predict-species-proba', methods=['POST'])
def predict_species_proba():
flower = {}
for feature in iris_classifier_features:
flower[feature] = [request.form[feature]]
flower = pd.DataFrame(flower)
probas = iris_classifier.predict_proba(flower[iris_classifier_features])[0, :].tolist()
[tool.poetry]
name = "tsgen"
version = "0.1.0"
description = "Time Series Generator"
authors = ["Marwan Debbiche <marwan.debbiche@example.com>"]
license = "MIT"
[tool.poetry.dependencies]
python = "^3.8"
pandas = "^1.1.3"
import math
import numpy as np
import pandas as pd
from tsgen.time_serie import TimeSerie
def affine(start, end, freq, start_y, end_y):
from tsgen.time_serie import TimeSerie
import tsgen.generators as generators
__all__ = ["TimeSerie", "generators"]
import pandas as pd
import numpy as np
import pytest
from tsgen import TimeSerie
@pytest.fixture
def ts_monthly_constant():
start = "2020"
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-yaml
- id: debug-statements
- id: end-of-file-fixer
- id: trailing-whitespace
- repo: local
hooks:
import math
import numpy as np # type: ignore
import pandas as pd # type: ignore
from tsgen.time_serie import TimeSerie
def affine(start, end, freq, start_y, end_y) -> TimeSerie: