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 sklearn.model_selection import train_test_split | |
| # Creating the training and testing data | |
| X_train, X_test, Y_train, Y_test = train_test_split(X, y, test_size=0.33) | |
| # Initializing an logistic regression object | |
| clf = LogisticRegression() | |
| # Fit the model to training and test sets | |
| clf.fit(X_train,Y_train) |
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 sklearn.datasets import load_iris | |
| from sklearn.linear_model import LogisticRegression | |
| X, y = load_iris() | |
| clf = LogisticRegression(random_state = 0).fit(X,y) | |
| clf.predict(X[:2,:]) | |
| clf.predict_proba(X[:2,:]) | |
| clf.score(X,y) |
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.
NewerOlder