我可以通过浏览器访问def train(self, train_list, target):
"""
:param data:
:param target: target class
:return:
For each target:
1. yield prior_prob: the probability of each class. P(class) eg P(Iris-virginica)
2. yield summary: list of {'mean': 0.0, 'stdev': 0.0}
"""
group = self.group_by_class(train_list, target)
self.summaries = {}
for target, features in group.iteritems():
self.summaries[target] = {
'prior_prob': self.prior_prob(group, target, train_list),
'summary': [i for i in self.summarize(features)],
}
return self.summaries
def group_by_class(self, data, target):
"""
:param data: Training set. Lists of events (rows) in a list
:param target: Index for the target column. Usually the last index in the list
:return:
Mapping each target to a list of it's features
"""
target_map = defaultdict(list)
for index in range(len(data)):
features = data[index]
if not features:
continue
x = features[target]
target_map[x].append(features[:-1]) # designating the last column as the class column
return dict(target_map)
,但是当我尝试使用http://****/***/ExternalService.svc?wsdl
访问它时,我超时了。如何使用Suds
访问.svc Web服务?我尝试过:
Suds
但这就是让我超时的原因。