import pandas as pd
      from sklearn.cross_validation import train_test_split
      import numpy as np
      from sklearn.preprocessing import StandardScaler
      import matplotlib.pyplot as plt
      from sklearn.linear_model import LogisticRegression
      
      dataset = pd.read_csv('file_name')
      x = []
      y = []
      xtrain, xtest, ytrain, ytest = train_test_split(x, y, test_size = 0.25, random_state = 0)
      sc_x = StandardScaler()
      xtrain = sc_x.fit_transform(xtrain) 
      xtest = sc_x.transform(xtest)
      classifier = LogisticRegression(random_state = 0)
      classifier.fit(xtrain, ytrain)
      y_pred = classifier.predict(xtest)
      
      Python language logo

      Logistic Regression

      Logistic Regression implementation in python

      0 Comments

        Add Comment

        Log in to add a comment

        Codiga - All rights reserved 2022.