import json
import pickle
import os

model_local_path = os.environ.get('MODEL_LOCAL_PATH', "pickled_model.pkl")


def lambda_handler(event, context):
    with open(model_local_path, 'rb') as f:
        model = pickle.load(f)

    body = event['body']
    if type(body) == str:
        data = json.loads(body)['data']
    else:
        data = body['data']
    input = float(data)

    # Predict class
    prediction = model.predict([[input]])[0]

    response = {
        "statusCode": 200,
        "body": json.dumps({
            "prediction": str(prediction),
        }),
    }

    return response

dc666c29d7ccbd8aac7153ba63b9205cf30310b3
<mask token>

<mask token>


def lambda_handler(event, context):
    with open(model_local_path, 'rb') as f:
        model = pickle.load(f)
    body = event['body']
    if type(body) == str:
        data = json.loads(body)['data']
    else:
        data = body['data']
    input = float(data)
    prediction = model.predict([[input]])[0]
    response = {'statusCode': 200, 'body': json.dumps({'prediction': str(
        prediction)})}
    return response

<mask token>
model_local_path = os.environ.get('MODEL_LOCAL_PATH', 'pickled_model.pkl')


def lambda_handler(event, context):
    with open(model_local_path, 'rb') as f:
        model = pickle.load(f)
    body = event['body']
    if type(body) == str:
        data = json.loads(body)['data']
    else:
        data = body['data']
    input = float(data)
    prediction = model.predict([[input]])[0]
    response = {'statusCode': 200, 'body': json.dumps({'prediction': str(
        prediction)})}
    return response

import json
import pickle
import os
model_local_path = os.environ.get('MODEL_LOCAL_PATH', 'pickled_model.pkl')


def lambda_handler(event, context):
    with open(model_local_path, 'rb') as f:
        model = pickle.load(f)
    body = event['body']
    if type(body) == str:
        data = json.loads(body)['data']
    else:
        data = body['data']
    input = float(data)
    prediction = model.predict([[input]])[0]
    response = {'statusCode': 200, 'body': json.dumps({'prediction': str(
        prediction)})}
    return response

import json
import pickle
import os

model_local_path = os.environ.get('MODEL_LOCAL_PATH', "pickled_model.pkl")


def lambda_handler(event, context):
    with open(model_local_path, 'rb') as f:
        model = pickle.load(f)

    body = event['body']
    if type(body) == str:
        data = json.loads(body)['data']
    else:
        data = body['data']
    input = float(data)

    # Predict class
    prediction = model.predict([[input]])[0]

    response = {
        "statusCode": 200,
        "body": json.dumps({
            "prediction": str(prediction),
        }),
    }

    return response
