-2
私は現在、以下の値でCSVをインデックスとエラーに実行しているため、サンプルの一貫性のない数に実行しているインデックス作成します私は間違って特定のパラメータと呼ばれているか、それが原因私がNaNの取り外しにある(データのほとんどのように、デフォルトと思われるが?)は、CSVは、ロジスティック回帰
"Classification","DGMLEN","IPLEN","TTL","IP"
"1","0.000000","192.168.1.5","185.60.216.35","TLSv1.2"
"2","0.000160","192.168.1.5","185.60.216.35","TCP"
"3","0.000161","192.168.1.5","185.60.216.35","TLSv1.2"
import pandas
df = pandas.read_csv('wcdemo.csv', header=0,
names = ["Classification", "DGMLEN", "IPLEN", "TTL", "IP"],
na_values='.')
df = df.apply(pandas.to_numeric, errors='coerce')
#Data=pd.read_csv ('wcdemo.csv').reset_index()#index_col='false')
feature_cols=['Classification','DGMLEN','IPLEN','IP']
X=df[feature_cols]
#datanewframe = pandas.Series(['Classification', 'DGMLEN', 'IPLEN', 'TTL', 'IP'], dtype='object')
#df = pandas.read_csv('wcdemo.csv')
#indexed_df = df.set_index(['Classification', 'DGMLEN','IPLEN','TTL','IP']
df['IPLEN'] = pandas.to_numeric(df['IPLEN'], errors='coerce').fillna(0)
df['TTL'] = pandas.to_numeric(df['TTL'], errors='coerce').fillna(0)
#DEFINE X TRAIN
X_train = df['IPLEN']
y_train = df['TTL']
#s = pandas.Series(['Classification', 'DGMLEN', 'IPLEN', 'TTL', 'IP'])
Y=df['TTL']
from sklearn.linear_model import LogisticRegression
logreg=LogisticRegression()
logreg.fit(X_train,y_train,).fillna(0.0)
#with the error being triggered here
logreg.fit(X_train,y_train,).fillna(0.0)