In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-09-21 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to write the program of python machine learning". The content of the article is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "how to write the program of python machine learning".
Background introduction
With only six lines of Python, you can write the first machine learning program in your life! We will program using a supervised learning method, that is, a machine learning method that uses examples to create classifiers. Completed using python's machine learning library scikit-learn, it has a variety of classification, regression and clustering algorithms, including support vector machines, random forests, gradient enhancement, k-means and DBSCAN, designed to interoperate with Python numerical and science libraries NumPy and SciPy.
Getting started exampl
Code block:
# use only six lines of Python statement You can write the first machine learning program in your life from sklearn import tree# We write a machine learning program to identify apples and oranges # features for training data to represent Apple, Weight and surface characteristics of oranges # 1: surface smooth 0: surface bumpy # 140g surface smooth apple # 130g surface smooth apple # 150g surface bumpy orange # 170g surface bumpy orange features = [1401] # lables gives us the expected result tag # 0: Apple 1: tangerine labels = [0Power0Power1] # define the decision tree classification dtc = tree.DecisionTreeClassifier () # training data clf = dtc.fit (features,labels) # the predicted input data is 1 Orange print (clf.predict ([150Co0])). Thank you for your reading. The above is the content of "how to write the program of python machine learning". After the study of this article, I believe you have a deeper understanding of how to write the program of python machine learning, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
The market share of Chrome browser on the desktop has exceeded 70%, and users are complaining about
The world's first 2nm mobile chip: Samsung Exynos 2600 is ready for mass production.According to a r
A US federal judge has ruled that Google can keep its Chrome browser, but it will be prohibited from
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
About us Contact us Product review car news thenatureplanet
More Form oMedia: AutoTimes. Bestcoffee. SL News. Jarebook. Coffee Hunters. Sundaily. Modezone. NNB. Coffee. Game News. FrontStreet. GGAMEN
© 2024 shulou.com SLNews company. All rights reserved.