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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@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() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[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" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
class TimeSerie: | |
def __init__(self, index, y): | |
if not isinstance(index, pd.DatetimeIndex): | |
raise TypeError("index should be a pandas.DatetimeIndex") | |
self.index = index | |
self.y = np.array(y) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from tsgen.time_serie import TimeSerie | |
import tsgen.generators as generators | |
__all__ = ["TimeSerie", "generators"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pandas as pd | |
import numpy as np | |
import pytest | |
from tsgen import TimeSerie | |
@pytest.fixture | |
def ts_monthly_constant(): | |
start = "2020" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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: |
OlderNewer