Python Forum
How to test and import a model form computer to test accuracy using Sklearn library
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to test and import a model form computer to test accuracy using Sklearn library
#1
Which types of data model we can test
like which format don't know i have some model i want to check the accuracy using logistic regression for the accuracy
I download some models
where my task to predict feathers for the same model using Secure KNN algorithm
Looks at the below codes
# read in the iris data
from sklearn.datasets import load_iris
iris = load_iris()

# create X (features) and y (response)
X = iris.data
y = iris.target
# import the class
from sklearn.linear_model import LogisticRegression

# instantiate the model (using the default parameters)
logreg = LogisticRegression()

# fit the model with data
logreg.fit(X, y)

# predict the response values for the observations in X
logreg.predict(X)
# store the predicted response values
y_pred = logreg.predict(X)

# check how many predictions were generated
len(y_pred)
Reply


Messages In This Thread
How to test and import a model form computer to test accuracy using Sklearn library - by Anldra12 - Jun-27-2021, 08:43 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Class test : good way to split methods into several files paul18fr 4 510 Jan-30-2024, 11:46 AM
Last Post: Pedroski55
  model.fit and model.predict errors hatflyer 6 1,387 Nov-10-2023, 01:39 AM
Last Post: hatflyer
  How to automate loop test check on Network device jpc230 1 598 Oct-09-2023, 09:54 PM
Last Post: Larz60+
  How to test the high-score in my Python-game Pluviometer 2 606 Oct-02-2023, 06:55 PM
Last Post: deanhystad
  unittest generates multiple files for each of my test case, how do I change to 1 file zsousa 0 979 Feb-15-2023, 05:34 PM
Last Post: zsousa
  Presenting random test questions oradba4u 2 927 Sep-27-2022, 04:23 PM
Last Post: deanhystad
  How to sort .csv file test log which item first fail and paint color SamLiu 24 5,076 Sep-03-2022, 07:32 AM
Last Post: Pedroski55
  Help with bleak - how to send test to BLE device? korenron 1 1,757 Aug-28-2022, 11:28 PM
Last Post: Larz60+
  Statsmodels, Dickey-Fuller test for stationarity Led_Zeppelin 1 970 Aug-17-2022, 06:36 PM
Last Post: Larz60+
  Membership test for an element in a list that is a dict value for a particular key? Mark17 2 1,233 Jul-01-2022, 10:52 PM
Last Post: Pedroski55

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020