python from quads import DecisionTree data = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] target = [0, 1, 0] model = DecisionTree() model.fit(data, target) new_data = [[2, 3, 4], [5, 6, 7]] prediction = model.predict(new_data) print(prediction) python from quads import NaiveBayes data = [['good', 'morning'], ['hello'], ['have', 'a', 'nice', 'day']] target = ['greeting', 'greeting', 'farewell'] model = NaiveBayes() model.fit(data, target) new_data = [['good', 'evening'], ['bye', 'bye']] prediction = model.predict(new_data) print(prediction) python from quads import SupportVectorMachine data = [[1, 2], [3, 4], [5, 6]] target = [0, 1, 0] model = SupportVectorMachine() model.fit(data, target) new_data = [[2, 3], [4, 5]] prediction = model.predict(new_data) print(prediction)


上一篇:
下一篇:
切换中文