Aylık arşivler: Şubat 2016

StringToWordVector Desc

Common

minTermFreq

The minimum (per-class) word frequency. Sets the minimum term frequency. This is enforced(impose) on a per-class basis.

wordsToKeep

This parameter basically determines the size of the dictionary (see method “determineDictionary()”) storing the tokenized substrings.

Less frequent substrings (must meet minTermFreq) will be pruned to cut down the size of dictionary. Duplicates across class labels will be removed from all but the first label it was encountered for as well.

The number of words in the output vector (per class if assigned).

The default number of words (per class if there is a class attribute assigned) to attempt to keep.

Approximate number of word attributes to create. Surplus(extra,additional,unused) words will be discarded. (default: 1000)

Restricts number of words to keep per class, thus for 2 classes, setting wordsToKeep to 50 gives you limit of a 100

It is not a strict constraint and it only affects where to prune the sorted occurences list, this can be altered:

// sort the array
sortArray(array);
if (array.length < m_WordsToKeep) {
// if there aren't enough words, set the threshold to
// minFreq
prune[z] = m_minTermFreq;
  } else {
// otherwise set it to be at least minFreq
prune[z] = Math.max(m_minTermFreq, 
    array[array.length - m_WordsToKeep]);
  }

 DoNotOperateOnPerClassBased değerine göre:
true için; her bir class sözcükleri ve tekrar sayıları bir dizide toplanır. Dizi kelime tekrar sayılarına göre desc sıralanır. Dizi uzunluğu wordstokeep değerinden küçükse mintermfreq dikkate alınarak, classlar içindeki sözcüklerden mintermfreq sayısınca tekrar edenler ve üstündekler attribute olarak alınır. Dizi uzunluğu wordstokeep değerinden büyükse, sıralı dizideki workdstokeep indisine denk gelen tekrar sayısı ve üstündeki sözcükler attribute olarak alınır (vektör olarak belirlenir).
false ise, tüm sözcükler dizi olarak tekrar sayısına göre desc sıralanır ve true için olan işlem uygulanır.

DoNotOperateOnPerClassBased = true (not based on class)

minTermFreq = N
If a term(word, ext.) count is not equal or greater then the minTermFreq (N in this case) inside corpus (all documents terms list) that term will be discarded from attributes.

C adet class olsun. Bir terimin(kelime) attribute listesinde olması için; C adet classın tüm sözcükleri içinde en az N defa geçmesi gerekir.

wordsToKeep = N
If wordsToKeep has value N, only the top-N most common tokens in all the string attribute values are kept, plus any tokens that are as common as the least common token amongst the top-N (i.e. ties aren’t broken).

DoNotOperateOnPerClassBased = false (based on class)

minTermFreq = N
C adet class olsun. Bir terimin(kelime) attribute listesinde olması için; C adet classın herhangi birisinin içinde >=N adet geçmesi gerekiyor.

wordsToKeep = N
A separate list is computed per class value using this process and subsequently the lists are merged.

Java snowball turkish to weka

Pages related to the subject:
https://weka.wikispaces.com/Stemmers
https://weka.wikispaces.com/Unofficial+packages+for+WEKA+3.7
https://github.com/fracpete/snowball-stemmers-weka-package
https://github.com/fracpete/snowball-stemmers-weka-package/releases

Download to Weka 3.7 : https://github.com/fracpete/snowball-stemmers-weka-package/releases -> snowball-stemmers-1.0.1.zip

Open weka package manager and install new zip package from top right file section
Now you can use this stemmers from stringtowordvector filter options. dont forget to select stemmer turkish

install mysql

mysql 5.7

sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ondrej/mysql-5.7
sudo apt-get update
sudo apt-get install mysql-server

mysql 5.6
sudo apt-get install software-properties-common
sudo add-apt-repository -y ppa:ondrej/mysql-5.6
sudo apt-get update
sudo apt-get install mysql-server

mysql completely remove

sudo apt-get remove --purge mysql* 
sudo apt-get autoremove 
sudo apt-get autoclean


service mysql stop
killall -KILL mysql mysqld_safe mysqld
apt-get --yes purge mysql-server mysql-client
apt-get --yes autoremove --purge
apt-get autoclean
deluser --remove-home mysql
delgroup mysql
rm -rf /etc/apparmor.d/abstractions/mysql /etc/apparmor.d/cache/usr.sbin.mysqld /etc/mysql /var/lib/mysql /var/log/mysql* /var/log/upstart/mysql.log* /var/run/mysqld
updatedb
sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean

after this, if you are having issues with re installing, Try to remove Mysql files in :

sudo rm -rf /var/lib/mysql


sudo apt-get remove --purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
sudo apt-get autoclean
sudo rm -rf /var/lib/mysql
sudo rm -rf /etc/mysql



 
 

apache maintanance 2

The Apache Web server is well equipped to run production level websites and web services. A production setup sometimes has scheduled downtimes. There are a number of ways to handle a maintenance downtime. You can either handle it inside of your web application by adding a page and directing all traffic to that page, or you can set up your web server in a sort of maintenance mode. In the maintenance mode, Apache will automatically direct all traffic to a maintenance page that you can set up. Let’s take a look at how this can be set up.

Enable .htaccess

There are two ways to make changes to your Apache configuration – editing the Apache configuration directly, or using .htaccess files and storing the configuration along with the website’s files. If you are hosted on a shared hosting platform, it is quite likely that the setup required to permit .htaccess files to function as desired has been done. If you are on a dedicated server, open the Apache configuration file httpd.conf in a text editor and look for a section containing the word AllowOverride. Make sure that this is set to allow all over rides by setting it toAllowOverride All. Now you should be able to use .htaccess files.

Create the Maintenance page

Next up you need to create a maintenance page that you will direct all the traffic to during maintenance periods. You can make it so that it simply says “Site Down for Maintenance. We’ll be Back Soon.” or you can create something more elaborate with images. I’ll leave the decision on how you want to create this page to you. We can proceed with the assumption that a page called maintenance.html has been created with the maintenance notice.

Enable Mod Rewrite

We have covered the setup and usage of the Apache module mod_rewrite in a previous article. Use the article to set up mod_rewrite. If you are not certain if mod_rewrite has been set up on your server, you can use an example from the linked article to test your setup. Note that the maintenance page redirection will not work correctly without a functional mod_rewrite setup.

Creating the .htaccess File

You can now set up the forwarding to the maintenance page. Create a file with the name .htaccess in the root directly of your website or web application. Enter the following bit of code into the file. Replacemaintenance.html with the name of your maintenance file.

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteRule $ /maintenance.html [R=302,L] 

Testing the Setup

Now that your setup is in place it’s time to run a test to make sure things are working as desired. Fire up your favorite web browser, clear the browser’s cache and history files, and then hit the URL of the site you just set to maintenance mode. You should be automatically redirected to the maintenance page. If not, revisit the set up instructions.

Getting out of Maintenance

When you are done with your site upgrade or maintenance work you should remember to roll back the changes we made here. For that all you need to do is to remove the code we added to the .htaccess file. Remove the code and test it in your web browser after clearing the cache files again.

IP Exceptions

If you are running an upgrade on your website, you will need to be able to look at and test out the site. There is a way by which you can post the maintenance notice for anyone hitting your websites but allow you to view the site as you would normally. For this, you will require a static public IP address. Add the following line to your.htaccess configuration:

RewriteCond %{REMOTE_HOST} !^117\.201\.1\.154

Replace 117\.201\.1\.154 with your IP address. Your code will now look something like this:

Options +FollowSymlinks
RewriteEngine on
RewriteCond %{REQUEST_URI} !/maintenance.html$
RewriteCond %{REMOTE_HOST} !^117\.201\.1\.154
RewriteRule $ /maintenance.html [R=302,L] 

Now launch the site in your web browser and you should see the site normally, while everyone else will be redirected to the maintenance page. Do remember to remove these settings once you are done with your maintenance work or upgrades.

apache maintanance

Create a file called maintenance.conf with the following in it:

#RewriteEngine On
#RewriteCond %{DOCUMENT_ROOT}/maintenance.html -f
#RewriteCond %{REQUEST_FILENAME} !/maintenance.html
#RewriteRule ^.*$    /maintenance.html [L]

Then setup your vhosts like:

<VirtualHost *>
  ServerAdmin admin@website.com
  DocumentRoot /var/www/website
  ServerName  website.com
  ServerAlias www.website.com      

  Include conf/maintenance.conf
</VirtualHost>

Then when you want to enable maintenance mode, just uncomment those lines in maintenance.conf and restart apache.

Alternatively you could make maintenace.conf.disabled and maintenace.conf.enabled. Then create a symbolic link for maintenance.conf to point to the enabled or disabled version of the file and bounce apache.

You could even wrap doing that in a script. One called enabled-maintence-mode.sh and disable-maintenance-mode.sh that would remove and create the symbolic links respectively and restart apache.