Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.


Have an account? Sign In Now

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here

Sorry, you do not have a permission to ask a question, You must login to ask question.

Forgot Password?

Need An Account, Sign Up Here
Sign InSign Up

Algoritmo Lab Forum

Algoritmo Lab Forum Logo Algoritmo Lab Forum Logo

Algoritmo Lab Forum Navigation

  • Forum
  • Algoritmo Lab
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Forum
  • Algoritmo Lab
Home/ Shivam17/Answers
Ask Shivam17
  • About
  • Questions
  • Polls
  • Answers
  • Best Answers
  • Asked Questions
  • Followed Questions
  • Favorite Questions
  • Groups
  • Posts
  • Comments
  • Followers Questions
  • Followers Answers
  • Followers Posts
  • Followers Comments
  1. Asked: January 26, 2021In: Python

    How can I validate user input in Python

    Shivam17

    Shivam17

    • 0 Questions
    • 2 Answers
    • 0 Best Answers
    • 29 Points
    View Profile
    Shivam17 SME
    Added an answer on January 26, 2021 at 5:31 pm

    To continue the input instead of getting the program terminated, we need to use the concept of "Try ... Except ..." block. Try... Except... blocks are used for Exception Handling. Whenever an error is occured, the except block handles it. And whenever the input is correct the loop will break. ExamplRead more

    To continue the input instead of getting the program terminated, we need to use the concept of “Try … Except …” block. Try… Except… blocks are used for Exception Handling.

    Whenever an error is occured, the except block handles it. And whenever the input is correct the loop will break.

    Example:

    ##########################################

    while True:
    try:
    integer_input = int(input(‘Enter a number: ‘))
    except:
    print(‘Input should be a number !!!’)
    else:
    print(‘\n\nCorrect Input …’)
    break

    print(‘The number entered is ‘, integer_input)

    ##########################################

    In the above program, we need an integer/numeric input. If an user enters ‘abcd’, instead of terminating the program, the program will go to except  block and this loop will continue till the user enters a correct input i.e. integer input.

    As soon as the user enters 43, the loop breaks.

    See less
    • 2
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
  2. Asked: January 22, 2021In: Linear Regression

    Model Export

    Shivam17

    Shivam17

    • 0 Questions
    • 2 Answers
    • 0 Best Answers
    • 29 Points
    View Profile
    Shivam17 SME
    Added an answer on January 26, 2021 at 5:02 pm

    The library 'pickle' is used to save a machine learning model ... To Save a Machine Learning Model:  ############################################# # Import the pickle library import pickle # Save the trained model model = pickle.dumps(model_object) ############################################# To loRead more

    The library ‘pickle’ is used to save a machine learning model …

    To Save a Machine Learning Model: 

    #############################################
    # Import the pickle library
    import pickle

    # Save the trained model
    model = pickle.dumps(model_object)
    #############################################

    To load the Machine Learning Model:

    # Load the model
    loaded_model = pickle.loads(model)

    #############################################

    Example:

    See less
    • 1
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp

Sidebar

Ask A Question
  • Popular
  • Answers
  • Tags
  • Aditya Sharma

    Are there any coding standards in Python?

    • 2 Answers
  • Bikash Ghosh

    Model Overfitting or Underfitting

    • 2 Answers
  • NehaSequeira

    Intercept in linear regression model

    • 2 Answers
  • NehaSequeira

    Scaling for numeric variables

    • 2 Answers
  • mahima_vaidya

    Multiple Linear Regression

    • 2 Answers
  • Dipayan Sarkar
    Dipayan Sarkar added an answer One of the assumptions of Linear Regression - No multicollinearity.… July 14, 2021 at 4:46 am
  • mahima_vaidya
    mahima_vaidya added an answer 'OLS' object has no attribute 'pvalues' This is the error… July 6, 2021 at 7:24 am
  • Dipayan Sarkar
    Dipayan Sarkar added an answer The statsmodels.regression.linear_model.OLSResults.pvalues should give you the pvalues of the respective… July 5, 2021 at 6:10 pm
  • shreemann
    shreemann added an answer If we remove the intercept then that would make the… June 23, 2021 at 4:53 am
  • Suchita
    Suchita added an answer When we scale the date prior to train-test split,  we… June 18, 2021 at 11:35 am
codingstandards linear regression logistic regression p-value python pythoncoding question

Top Members

Dipayan Sarkar

Dipayan Sarkar

  • 0 Questions
  • 39 Points
SME
Shivam17

Shivam17

  • 0 Questions
  • 29 Points
SME
Prasad Valse

Prasad Valse

  • 0 Questions
  • 28 Points
SME

Explore

  • Recent Questions
  • Feed
  • Most Answered
  • Answers
  • No Answers
  • Most Visited
  • Most Voted

© 2021 Algoritmo Lab. All Rights Reserved