Python适合数据挖掘? [英] Python good for data mining?

查看:101
本文介绍了Python适合数据挖掘?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开始一个数据挖掘项目,我正在考虑将Python和

Java作为可能的平台。


我'' m表现得很好。大多数基准测试报告说,Java比Python快10-15倍,而且我自己的实验确认了这个。我可以想象这对于非常大的
数据集来说会成为问题。


Python中与MySQL的集成有多好?

用户界面怎么样?使用Tkinter来开发没有IDE的用户界面是多么容易?
用IDE? (

IDE?)

如果我将我的Python库用于用

PHP编写的网站,该怎么办? Perl或Java - 我如何与Python集成?


由于种种原因,我非常喜欢Python,并且希望避免使用
Java。 />

对不起 - 这里有很多问题 - 但我期待你的回复!

I''m starting a project in data mining, and I''m considering Python and
Java as possible platforms.

I''m conserned by performance. Most benchmarks report that Java is
about 10-15 times faster than Python, and my own experiments confirms
this. I could imagine this to become a problem for very large
datasets.

How good is the integration with MySQL in Python?

What about user interfaces? How easy is it to use Tkinter for
developing a user interface without an IDE? And with an IDE? (which
IDE?)

What if I were to use my Python libraries with a web site written in
PHP, Perl or Java - how do I intergrate with Python?

I really like Python for a number of reasons, and would like to avoid
Java.

Sorry - lot of questions here - but I look forward to your replies!

推荐答案

Jens写道:
Jens wrote:

我正在开始一个数据挖掘项目,我正在考虑使用Python和

Java作为可能的平台。


我很担心表现。大多数基准测试报告说,Java比Python快10-15倍,而且我自己的实验确认了这个。我可以想象这会成为非常大的b
数据集的问题。
I''m starting a project in data mining, and I''m considering Python and
Java as possible platforms.

I''m concerned by performance. Most benchmarks report that Java is
about 10-15 times faster than Python, and my own experiments confirms
this. I could imagine this to become a problem for very large
datasets.



如果大多数处理是通过SQL调用完成的,那么这不应该是一个问题。我在悉尼大学认识了几个使用Python进行数据挖掘的人。我认为他们使用的是sqlite3和MySQL。

If most of the processing is done with SQL calls, this shouldn''t be an
issue. I''ve known a couple of people at Sydney University who were
using Python for data mining. I think they were using sqlite3 and MySQL.


>

在Python中与MySQL的集成有多好?
>
How good is the integration with MySQL in Python?



从来没有尝试过,但快速谷歌揭示了你可以尝试的一些方法 - MySQLdb模块,MySQL for Python等。

Never tried it, but a quick google reveals a number of approaches you
could try - the MySQLdb module, MySQL for Python, etc.


>

用户界面怎么样?使用Tkinter来开发没有IDE的用户界面是多么容易?
用IDE? (

IDE?)
>
What about user interfaces? How easy is it to use Tkinter for
developing a user interface without an IDE? And with an IDE? (which
IDE?)



当我学习如何创建GUI时,WxPython被推荐给我。

它具有比Tkinter更多的功能,以及更加原生的外观和感觉。

平台。使用WxPython,在不使用IDE的情况下,为几个程序创建多窗格,b $ b选项卡界面相当容易。

演示/教程非常棒。

WxPython was recommended to me when I was learning how to create a GUI.
It has more features than Tkinter and a more native look and feel across
platforms. With WxPython it was fairly easy to create a multi-pane,
tabbed interface for a couple of programs, without using an IDE. The
demos/tutorials were fantastic.


>

如果我使用我的Python库怎么办?用一个用/ b
PHP,Perl或Java编写的网站 - 如何与Python集成?
>
What if I were to use my Python libraries with a web site written in
PHP, Perl or Java - how do I integrate with Python?



可能最简单的方法是python .cgi文件。 cgi和cgitb

模块可以非常轻松地读取表单数据。饼干也很简单。对于更复杂但更可定制的方法,您可以查看BaseHTTPServer模块或某种类型的套接字监听器,与公共或私有的Web服务器一起运行。

公开说你会从你的其他php /无论什么页面链接到
python服务器。私有地,php / perl / java后端会从本地python服务器请求

数据,然后通过主服务器(apache?)将结果返回给客户端。

Possibly the simplest way would be python .cgi files. The cgi and cgitb
modules allow form data to be read fairly easily. Cookies are also
fairly simple. For a more complicated but more customisable approach,
you could look in to the BaseHTTPServer module or a socket listener of
some sort, running that alongside the webserver publicly or privately.
Publicly you''d have links from the rest of your php/whatever pages to
the python server. Privately the php/perl/java backend would request
data from the local python server before feeding the results back
through the main server (apache?) to the client.


如果我将我的Python库用于用
编写的网站
What if I were to use my Python libraries with a web site written in

PHP,Perl或Java - 如何与Python集成?
PHP, Perl or Java - how do I integrate with Python?



可能最简单的方法是python .cgi文件。 cgi和cgitb

模块可以非常轻松地读取表单数据。饼干也很简单。对于更复杂但更可定制的方法,您可以查看BaseHTTPServer模块或某种类型的套接字监听器,与公共或私有的Web服务器一起运行。

公开说你会从你的其他php /无论什么页面链接到
python服务器。私有地,php / perl / java后端会从本地python服务器请求

数据,然后通过主服务器(apache?)将结果反馈给客户端。


Possibly the simplest way would be python .cgi files. The cgi and cgitb
modules allow form data to be read fairly easily. Cookies are also
fairly simple. For a more complicated but more customisable approach,
you could look in to the BaseHTTPServer module or a socket listener of
some sort, running that alongside the webserver publicly or privately.
Publicly you''d have links from the rest of your php/whatever pages to
the python server. Privately the php/perl/java backend would request
data from the local python server before feeding the results back
through the main server (apache?) to the client.



非常感谢!我不确定我是否完全理解你的描述

如何集成Python,比如PHP。你能给一个小的

例子吗?我没有使用CGI进行Python Web开发的经验。

与PHP中的Web开发相比有多容易?


我仍​​然没有让我的注意我的数据挖掘项目的编程选择

语言。我认为这是一个很难的决定。我的心告诉我Python我的脑袋告诉我Java :-)

Thanks a lot! I''m not sure I completely understand your description of
how to integrate Python with, say PHP. Could you please give a small
example? I have no experience with Python web development using CGI.
How easy is it compared to web development in PHP?

I still havent''t made my mind up about the choice of programming
language for my data mining project. I think it''s a difficult
decision. My heart tells me "Python" and my head tells me "Java" :-)


Jens写道:
Jens wrote:

>

非常感谢!我不确定我是否完全理解你的描述

如何集成Python,比如PHP。你能给一个小的

例子吗?我没有使用CGI进行Python Web开发的经验。

与PHP中的Web开发相比有多容易?


我仍​​然没有让我的注意我的数据挖掘项目的编程选择

语言。我认为这是一个很难的决定。我的心告诉我Python我的脑袋告诉我Java :-)
>
Thanks a lot! I''m not sure I completely understand your description of
how to integrate Python with, say PHP. Could you please give a small
example? I have no experience with Python web development using CGI.
How easy is it compared to web development in PHP?

I still havent''t made my mind up about the choice of programming
language for my data mining project. I think it''s a difficult
decision. My heart tells me "Python" and my head tells me "Java" :-)



我的C ++讲师过去常常告诉我们'''C ++或Java?''永远不是问题。

For重要的是,Java永远不是答案。


至于python和cgi,它非常简单。而不是.php文件由php-handler处理的

,你有一个.cgi文件,由

cgi-handler处理。将html表单的操作设置为.cgi文件。在.cgi文件的

顶部,你需要一行如下:


#!/ usr / bin / env python


这告诉它使用python作为解释器。你需要一些进口:


import cgi

import cgitb; cgitb.enable()#用于调试 - 它htmlises

#您的异常和错误消息。

print""" Content-type:text / html; charset =" iso-8859-1"; \ n"""

#你需要那条线或类似的东西,以便浏览器知道要做什么?
做什么使用脚本的输出。


python脚本打印的所有东西直接进入

客户端的浏览器,所以脚本将不得不打印HTML。 cgi模块

处理表单数据,通常formdata = cgi.FieldStorage()将在表单发送到脚本时填充
。打印它,看看它里面有什么。


从这里开始,在

网页上有大量关于python和cgi的教程我累了。


祝你好运,


Cameron。

My C++ lecturer used to tell us "''C++ or Java?'' is never the question.
For that matter, Java is never the answer."

As for python and cgi, it''s pretty simple. Instead of a .php file to be
handled by the php-handler, you have a .cgi file which is handled by the
cgi-handler. Set the action of your html form to the .cgi file. At the
top of the .cgi file, you''ll need a line like:

#!/usr/bin/env python

Which tells it to use python as the interpreter. You''ll need a few imports:

import cgi
import cgitb; cgitb.enable() # for debugging - it htmlises
# your exceptions and error messages.
print """Content-type: text/html; charset="iso-8859-1";\n"""
# You need that line or something similar so the browser knows what to
do with the output of the script.

Everything that''s printed by the python script goes straight to the
client''s browser, so the script will have to print html. The cgi module
handles form data, typically formdata = cgi.FieldStorage() will be
filled when a form is sent to the script. print it and see what''s in it.

From here, there''s a huge number of tutorials on python and cgi on the
web and I''m tired.

Best of luck,

Cameron.


这篇关于Python适合数据挖掘?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆