is there any code refrance avliable to deploy a model RandomForestClassifier using Flask [duplicate]Post JSON using Python RequestsHow to get POSTed json in Flask?Is there any way to kill a Thread?Configure Flask dev server to be visible across the networkHow to get data received in Flask requestHow do you get a query string on Flask?Return JSON response from Flask viewHow to serve static files in FlaskError processing Json requestTwitter oauth with flask_oauthlib, Failed to generate request tokenFlask POSTs with Trailing SlashERROR : TypeError: Object of type 'int64' is not JSON serializable and json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)

Is there a way to save this session?

How do I get a cleat that's stuck in a pedal, detached from the shoe, out?

Can I ask a publisher for a paper that I need for reviewing

Is American Express widely accepted in France?

What are the problems in teaching guitar via Skype?

Are grass strips more dangerous than tarmac?

How should I push back against my job assigning "homework"?

What does it mean by "d-ism of Leibniz" and "dotage of Newton" in simple English?

How crucial is a waifu game storyline?

Is it possible to kill all life on Earth?

Can a helicopter mask itself from Radar?

What should I do about a religious player who refuses to accept the existence of multiple gods in D&D?

Explain Ant-Man's "not it" scene from Avengers: Endgame

Humans meet a distant alien species. How do they standardize? - Units of Measure

What people are called "кабан" and why?

PhD student with mental health issues and bad performance

Why is there a need to modify system call tables in Linux?

Accidentally cashed a check twice

What does War Machine's "Canopy! Canopy!" line mean in "Avengers: Endgame"?

What caused the tendency for conservatives to not support climate change regulations?

Can you please explain this joke: "I'm going bananas is what I tell my bananas before I leave the house"?

Why use water tanks from a retired Space Shuttle?

Creating Fictional Slavic Place Names

How can I offer a test ride while selling a bike?



is there any code refrance avliable to deploy a model RandomForestClassifier using Flask [duplicate]


Post JSON using Python RequestsHow to get POSTed json in Flask?Is there any way to kill a Thread?Configure Flask dev server to be visible across the networkHow to get data received in Flask requestHow do you get a query string on Flask?Return JSON response from Flask viewHow to serve static files in FlaskError processing Json requestTwitter oauth with flask_oauthlib, Failed to generate request tokenFlask POSTs with Trailing SlashERROR : TypeError: Object of type 'int64' is not JSON serializable and json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty height:90px;width:728px;box-sizing:border-box;








0
















This question already has an answer here:



  • Post JSON using Python Requests

    6 answers



  • How to get POSTed json in Flask?

    5 answers



I want to deploy a model RandomForestClassifier using Flask.
I got reference in git hub-https://github.com/a-djebali/flask-machine-learning-resful



but when I send request to service it will not work instead error given,



Request.py code below



import requests
import json
import numpy as np



url = "http://127.0.0.1:9000/predict_api"
data = json.dumps('sl':5.84,'sw':3.0,'pl':3.75,'pw':1.1)
r = requests.post(url,data)
print(r.json())


for post app.py
Below Code



import numpy as np
from flask import Flask, abort, jsonify, request
import pickle as pickle

random_forest_model = pickle.load(open("rfc.pkl","rb"))

app = Flask(__name__)

@app.route('/predict_api', methods=['POST'])
def predict():
# Error checking
data = request.get_json(force=True)

# Convert JSON to numpy array
predict_request = [data['sl'],data['sw'],data['pl'],data['pw']]
predict_request = np.array(predict_request)

# Predict using the random forest model
y = random_forest_model.predict(predict_request)

# Return prediction
output = [y[0]]
return jsonify(results=output)

if __name__ == '__main__':
app.run(port = 9000, debug = True)


Error Message




File "C:Anacondalibjsondecoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None



JSONDecodeError: Expecting value




is any body try to use Flask web service please help me










share|improve this question















marked as duplicate by davidism python
Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 24 at 14:47


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























    0
















    This question already has an answer here:



    • Post JSON using Python Requests

      6 answers



    • How to get POSTed json in Flask?

      5 answers



    I want to deploy a model RandomForestClassifier using Flask.
    I got reference in git hub-https://github.com/a-djebali/flask-machine-learning-resful



    but when I send request to service it will not work instead error given,



    Request.py code below



    import requests
    import json
    import numpy as np



    url = "http://127.0.0.1:9000/predict_api"
    data = json.dumps('sl':5.84,'sw':3.0,'pl':3.75,'pw':1.1)
    r = requests.post(url,data)
    print(r.json())


    for post app.py
    Below Code



    import numpy as np
    from flask import Flask, abort, jsonify, request
    import pickle as pickle

    random_forest_model = pickle.load(open("rfc.pkl","rb"))

    app = Flask(__name__)

    @app.route('/predict_api', methods=['POST'])
    def predict():
    # Error checking
    data = request.get_json(force=True)

    # Convert JSON to numpy array
    predict_request = [data['sl'],data['sw'],data['pl'],data['pw']]
    predict_request = np.array(predict_request)

    # Predict using the random forest model
    y = random_forest_model.predict(predict_request)

    # Return prediction
    output = [y[0]]
    return jsonify(results=output)

    if __name__ == '__main__':
    app.run(port = 9000, debug = True)


    Error Message




    File "C:Anacondalibjsondecoder.py", line 357, in raw_decode
    raise JSONDecodeError("Expecting value", s, err.value) from None



    JSONDecodeError: Expecting value




    is any body try to use Flask web service please help me










    share|improve this question















    marked as duplicate by davidism python
    Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

    StackExchange.ready(function()
    if (StackExchange.options.isMobile) return;

    $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
    var $hover = $(this).addClass('hover-bound'),
    $msg = $hover.siblings('.dupe-hammer-message');

    $hover.hover(
    function()
    $hover.showInfoMessage('',
    messageElement: $msg.clone().show(),
    transient: false,
    position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
    dismissable: false,
    relativeToBody: true
    );
    ,
    function()
    StackExchange.helpers.removeMessages();

    );
    );
    );
    Mar 24 at 14:47


    This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.




















      0












      0








      0









      This question already has an answer here:



      • Post JSON using Python Requests

        6 answers



      • How to get POSTed json in Flask?

        5 answers



      I want to deploy a model RandomForestClassifier using Flask.
      I got reference in git hub-https://github.com/a-djebali/flask-machine-learning-resful



      but when I send request to service it will not work instead error given,



      Request.py code below



      import requests
      import json
      import numpy as np



      url = "http://127.0.0.1:9000/predict_api"
      data = json.dumps('sl':5.84,'sw':3.0,'pl':3.75,'pw':1.1)
      r = requests.post(url,data)
      print(r.json())


      for post app.py
      Below Code



      import numpy as np
      from flask import Flask, abort, jsonify, request
      import pickle as pickle

      random_forest_model = pickle.load(open("rfc.pkl","rb"))

      app = Flask(__name__)

      @app.route('/predict_api', methods=['POST'])
      def predict():
      # Error checking
      data = request.get_json(force=True)

      # Convert JSON to numpy array
      predict_request = [data['sl'],data['sw'],data['pl'],data['pw']]
      predict_request = np.array(predict_request)

      # Predict using the random forest model
      y = random_forest_model.predict(predict_request)

      # Return prediction
      output = [y[0]]
      return jsonify(results=output)

      if __name__ == '__main__':
      app.run(port = 9000, debug = True)


      Error Message




      File "C:Anacondalibjsondecoder.py", line 357, in raw_decode
      raise JSONDecodeError("Expecting value", s, err.value) from None



      JSONDecodeError: Expecting value




      is any body try to use Flask web service please help me










      share|improve this question

















      This question already has an answer here:



      • Post JSON using Python Requests

        6 answers



      • How to get POSTed json in Flask?

        5 answers



      I want to deploy a model RandomForestClassifier using Flask.
      I got reference in git hub-https://github.com/a-djebali/flask-machine-learning-resful



      but when I send request to service it will not work instead error given,



      Request.py code below



      import requests
      import json
      import numpy as np



      url = "http://127.0.0.1:9000/predict_api"
      data = json.dumps('sl':5.84,'sw':3.0,'pl':3.75,'pw':1.1)
      r = requests.post(url,data)
      print(r.json())


      for post app.py
      Below Code



      import numpy as np
      from flask import Flask, abort, jsonify, request
      import pickle as pickle

      random_forest_model = pickle.load(open("rfc.pkl","rb"))

      app = Flask(__name__)

      @app.route('/predict_api', methods=['POST'])
      def predict():
      # Error checking
      data = request.get_json(force=True)

      # Convert JSON to numpy array
      predict_request = [data['sl'],data['sw'],data['pl'],data['pw']]
      predict_request = np.array(predict_request)

      # Predict using the random forest model
      y = random_forest_model.predict(predict_request)

      # Return prediction
      output = [y[0]]
      return jsonify(results=output)

      if __name__ == '__main__':
      app.run(port = 9000, debug = True)


      Error Message




      File "C:Anacondalibjsondecoder.py", line 357, in raw_decode
      raise JSONDecodeError("Expecting value", s, err.value) from None



      JSONDecodeError: Expecting value




      is any body try to use Flask web service please help me





      This question already has an answer here:



      • Post JSON using Python Requests

        6 answers



      • How to get POSTed json in Flask?

        5 answers







      python flask






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited Mar 24 at 11:21









      Vadim Kotov

      5,04673550




      5,04673550










      asked Mar 24 at 11:18









      manish vermamanish verma

      41




      41




      marked as duplicate by davidism python
      Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 24 at 14:47


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









      marked as duplicate by davidism python
      Users with the  python badge can single-handedly close python questions as duplicates and reopen them as needed.

      StackExchange.ready(function()
      if (StackExchange.options.isMobile) return;

      $('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
      var $hover = $(this).addClass('hover-bound'),
      $msg = $hover.siblings('.dupe-hammer-message');

      $hover.hover(
      function()
      $hover.showInfoMessage('',
      messageElement: $msg.clone().show(),
      transient: false,
      position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
      dismissable: false,
      relativeToBody: true
      );
      ,
      function()
      StackExchange.helpers.removeMessages();

      );
      );
      );
      Mar 24 at 14:47


      This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.
























          0






          active

          oldest

          votes

















          0






          active

          oldest

          votes








          0






          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes

          Popular posts from this blog

          Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

          SQL error code 1064 with creating Laravel foreign keysForeign key constraints: When to use ON UPDATE and ON DELETEDropping column with foreign key Laravel error: General error: 1025 Error on renameLaravel SQL Can't create tableLaravel Migration foreign key errorLaravel php artisan migrate:refresh giving a syntax errorSQLSTATE[42S01]: Base table or view already exists or Base table or view already exists: 1050 Tableerror in migrating laravel file to xampp serverSyntax error or access violation: 1064:syntax to use near 'unsigned not null, modelName varchar(191) not null, title varchar(191) not nLaravel cannot create new table field in mysqlLaravel 5.7:Last migration creates table but is not registered in the migration table

          은진 송씨 목차 역사 본관 분파 인물 조선 왕실과의 인척 관계 집성촌 항렬자 인구 같이 보기 각주 둘러보기 메뉴은진 송씨세종실록 149권, 지리지 충청도 공주목 은진현