feature_data = "[[140, 1], [130, 1], [150, 0], [170, 0]]"
X = np.array(feature_data).reshape(-1,1)
feature_data = "[[140, 1], [130, 1], [150, 0], [170, 0]]"
feature_data = json.loads(feature_data)
X = np.array(feature_data).reshape(-1,1)
@client.command(pass_context=True)
async def machlearn(ctx, feature_data, target_data, new_data):
X = np.array(json.loads(feature_data)).reshape(-1,1)
y = np.array(json.loads(target_data)).reshape(-1,1)
classify_method = rn.randint(0, 1)
if classify_method == 0:
clf = DecisionTreeClassifier()
if classify_method == 1:
clf = KNeighborsClassifier()
clf.fit(X, y)
pred = clf.predict(np.array(json.loads(new_data)).reshape(-1,1))
metr = accuracy_score(y, pred)
await ctx.send(f"{author.mention} Result: " + str(metr))
import json
arr = json.loads('[[140, 1], [130, 1], [150, 0], [170, 0]]')
iframe = driver.find_element_by_xpath("xpath для iframe")
driver.switch_to.frame(iframe)
driver.find_element_by_xpath('//input[@id="cardCvc-input"]').send_keys(000)
driver.switch_to.default_content()