2021年3月9日星期二

Logistic regression output is blank- not sure why?

from __future__ import division  import numpy as np  import matplotlib.pyplot as plt  from sklearn import datasets, linear_model  import pandas as pd  from pandas import DataFrame, Series  import seaborn as sns  import math  from sklearn.metrics import r2_score  from sklearn.model_selection import train_test_split  from sklearn.linear_model import LogisticRegression  %matplotlib inline    data=pd.read_csv("wells.dat", delim_whitespace=True)  #datas=pd.read_csv('wells.dat', header=0, sep='\s+')  data.head()  #data.info()  #print(data)  xdist=data["dist"].to_numpy()  print(xdist)  xdist=xdist.reshape(-1,1)  print(xdist)  xdist=[np.append([1],x) for x in xdist]  #print(xdist)  print(len(xdist))    y=list(data["switch"])    X_train,X_test,y_train,y_test=train_test_split(xdist,y,test_size=0.5,random_state=0)    model=LogisticRegression()  model.fit(X_train,y_train)  print(model)  

output is just "LogisticRegression()" when it should be like "LogisticRegression(C=1.0,class_weight=None.....warm_start=False)" So i'm not sure why I'm not getting an output?

this is what the dataframe looks like:

enter image description here

and the data info looks like this: enter image description here

https://stackoverflow.com/questions/66558233/logistic-regression-output-is-blank-not-sure-why March 10, 2021 at 12:07PM

没有评论:

发表评论