96%-я точность предлагает, чтобы у Вас было действительно плотное прилегание к Вашим обучающим данным. 50%-я точность при тестировании данных показывает, что Ваша модель не может составлять шум/изменчивость изучаемых данных. Это похоже на сверхустановку учебника.
Вы, кажется, называете свои данные проверки Вашими данными тестирования. Возможно, можно ли лучше разделить данные?
Python-способ написания веб-приложений отличается от cgi-bin. Это достигается с помощью WSGI .
WSGI - это стандартный интерфейс между веб-серверами и веб-приложениями или фреймворками Python. Его определяет PEP 0333 .
Использование его вместо CGI не имеет недостатков. И вы получите много. Красивые URL-адреса - это лишь одна из тех изящных вещей, которые вы можете легко сделать.
Кроме того, написание приложения WSGI означает, что вы можете развернуть его на любом веб-сервере, поддерживающем интерфейс WSGI. Apache делает это с помощью mod_wsgi .
Вы можете настроить его в apache следующим образом:
WSGIScriptAlias /myapp /usr/local/www/wsgi-scripts/myapp.py
Тогда все запросы на http: //myserver.domain/myapp
будут отправляться на Вызываемое приложение myapp.py
, включая http: //myserver.domain/myapp/something/here
.
пример myapp.py
:
def application(environ, start_response):
start_response('200 OK', [('Content-type', 'text/plain')])
return ['Hello World!']
I think you can do this by rewriting URL through Apache configuration. You can see the Apache documentation for rewriting here.
You have to use URL Rewriting.
It is not a noob question, it can be quite tricky :)
http://httpd.apache.org/docs/2.0/misc/rewriteguide.html
Hope you find it helpful
Just use some good web framework e.g. django and you can have such URLs more than URLs you will have a better infrastructure, templates, db orm etc
this is an excerpt from a .htaccess that I use to achieve such a thing, this for example redirects all requests that were not to index.php to that file, of course you then have to check the server-variables within the file you redirect to to see, what was requested.
Or you simply make a rewrite rule, where you use a RegExp like ^.*\/cgi-bin\/.*\.py$
to determine when and what to rewrite. Such a RegExp must be crafted very carefully, so that rewriting only takes place when desired.
<IfModule mod_rewrite.c>
RewriteEngine On #activate rewriting
RewriteBase / #url base for rewriting
RewriteCond %{REQUEST_FILENAME} !index.php #requested file is not index.php
RewriteCond %{REQUEST_FILENAME} !^.*\.gif$ #requested file is no .gif
RewriteCond %{REQUEST_FILENAME} !^.*\.jpg$ #requested file is no .jpg
RewriteCond %{REQUEST_FILENAME} !-d #is not a directory
RewriteRule . /index.php [L] #send it all to index.php
</IfModule>
The above Example uses RewriteCond
itions to determine when to rewrite ( .gif's, .jpeg's and index.php are excluded ).
Hmm, so thats a long text already. Hope it was a bit helpful, but you won't be able to avoid learning the syntax of the Apache RewriteEngine.
Вы найдете полезной директиву ScriptAlias
. Используя
ScriptAlias /urlpath /your/cgi-bin/script.py
, вы можете получить доступ к своему скрипту через http: // yourserver / urlpath
.
Вы также можете изучить mod_passenger
, хотя в последний раз, когда я его использовал, WSGI был своего рода «гражданином второго сорта» в библиотеке - он мог обнаруживать сценарии WSGI, если бы он использовался для обслуживания всего домена, но в остальном нет никаких директив, заставляющих его запускать приложение WSGI.