In[5]没有问题,问题在于第一段的问题,
1,init前后各有两个下划线,不是一个,即__init__
2,net_input和predict方法应该和fit方法是并列而非包含
位置参考如下:
class Perceptron(object):
def __init__(self, eta = 0.01, n_iter=10):
pass
def fit(self, X, y):
pass
def net_input(self, X):
pass
def predict(self, X):
pass
pass
1,init前后各有两个下划线,不是一个,即__init__
2,net_input和predict方法应该和fit方法是并列而非包含
位置参考如下:
class Perceptron(object):
def __init__(self, eta = 0.01, n_iter=10):
pass
def fit(self, X, y):
pass
def net_input(self, X):
pass
def predict(self, X):
pass
pass
2018-01-23
$arr=[[1,2],[3,4]];
//正常输出
foreach ($arr as $val)
{
foreach ($val as $key1=>$val1)
{
echo $val1;
}
echo "<br/>";
}
//转置
foreach ($arr as $keyi=>$vali)
{
foreach ($vali as $keyj=>$valj)
{
echo $arr[$keyj][$keyi];
}
echo "<br/>";
}
//正常输出
foreach ($arr as $val)
{
foreach ($val as $key1=>$val1)
{
echo $val1;
}
echo "<br/>";
}
//转置
foreach ($arr as $keyi=>$vali)
{
foreach ($vali as $keyj=>$valj)
{
echo $arr[$keyj][$keyi];
}
echo "<br/>";
}
2018-01-09
已采纳回答 / qq_Sunshine暖阳_0
5.1,3.5,1.4,0.2,Iris-setosa4.9,3.0,1.4,0.2,Iris-setosa4.7,3.2,1.3,0.2,Iris-setosa4.6,3.1,1.5,0.2,Iris-setosa5.0,3.6,1.4,0.2,Iris-setosa5.4,3.9,1.7,0.4,Iris-setosa4.6,3.4,1.4,0.3,Iris-setosa5.0,3.4,1.5,0.2,Iris-setosa4.4,2.9,1.4,0.2,Iris-setosa4.9,3.1,1.5,...
2018-01-09