简体   繁体   English

如何将此代码中的数据保存在单独的文件中以创建机器学习 model?

[英]How can I save data from this code in separate files to create a machine learning model?

So the goal is to record my mouse data and create a program that mimics human behavior to automate actions within a video game.因此,目标是记录我的鼠标数据并创建一个模仿人类行为的程序,以在视频游戏中自动执行操作。

mouse_events = []


mouse.hook(mouse_events.append)
keyboard.start_recording()

keyboard.wait("a")

mouse.unhook(mouse_events.append)
keyboard_events = keyboard.stop_recording()

#Keyboard threadings:

k_thread = threading.Thread(target = lambda :keyboard.play(keyboard_events))
k_thread.start()

#Mouse threadings:

m_thread = threading.Thread(target = lambda :mouse.play(mouse_events))
m_thread.start()

#waiting for both threadings to be completed

k_thread.join()
m_thread.join()

You can use pickle or joblib from scikit learn.您可以使用 scikit learn 中的 pickle 或 joblib。 Both have the function dump which will solve your problem.两者都有 function 转储,可以解决您的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 我如何保存需要更少 memory 的机器学习 model - How can i save a machine learning model that takes less memory 如何稳定机器学习 model? - How can I stabilize a machine learning model? 如何将一系列 numpy ndarrays 作为输入数据来训练 tensorflow 机器学习模型? - How can I have a series of numpy ndarrays as the input data to train a tensorflow machine learning model? 如何在机器学习 model 中使用 test_proportion 数据? - How can I use the test_proportion data in a machine learning model? 如何将分类机器学习 Model 从一个数据集转移到另一个数据集? - How do I transfer a Classification Machine Learning Model from one data set to another? 如何在没有数据的情况下设置机器学习 model - How to set up a machine learning model with no data 如何将标头添加到我从机器学习数据库中提取的以下数据中 - How can I add header to the following data that I am pulling from the machine learning database 无法为机器学习创建 model - Cannot create model for machine learning 如何在单次训练期间保存和快照机器学习模型? - How to save and snapshot machine learning model during a single training? 我可以将数据从本地SQL Server数据库导入到Azure机器学习虚拟机吗? - Can I import data from On-Premises SQL Server Database to Azure Machine Learning virtual machine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM