<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Artificial-Intelligence on despatches</title><link>https://icle.es/tags/artificial-intelligence/</link><description>Recent content in Artificial-Intelligence on despatches</description><generator>Hugo</generator><language>en</language><lastBuildDate>Fri, 20 Jun 2025 08:42:17 +0100</lastBuildDate><atom:link href="https://icle.es/tags/artificial-intelligence/index.xml" rel="self" type="application/rss+xml"/><item><title>[Mahout] Deploying custom drivers to mahout</title><link>https://icle.es/2016/08/09/mahout-deploying-custom-drivers-to-mahout/</link><pubDate>Tue, 09 Aug 2016 13:16:11 +0000</pubDate><guid>https://icle.es/2016/08/09/mahout-deploying-custom-drivers-to-mahout/</guid><description>&lt;p>Developing custom drivers on Mahout is fairly straightforward. You can inherit
from MahoutDriver for Java drivers and MahourSparkDriver for spark drivers.&lt;/p>
&lt;p>The Javadoc for MahoutDriver (if you can find it) provides a good summary of how
to implement it&lt;/p>
&lt;blockquote>
&lt;p>[General-purpose driver class for Mahout programs. Utilizes &amp;gt; &amp;gt;
org.apache.hadoop.util.ProgramDriver to run main methods of other &amp;gt; classes, &amp;gt;
but first loads up default properties from a properties &amp;gt;&lt;/p>
&lt;blockquote>
&lt;p>file.]{style=&amp;ldquo;color:#353833;font-family:Arial, Helvetica,
sans-serif;font-size:12.16px;line-height:normal;&amp;rdquo;}&lt;/p></description><content:encoded><![CDATA[<p>Developing custom drivers on Mahout is fairly straightforward. You can inherit
from MahoutDriver for Java drivers and MahourSparkDriver for spark drivers.</p>
<p>The Javadoc for MahoutDriver (if you can find it) provides a good summary of how
to implement it</p>
<blockquote>
<p>[General-purpose driver class for Mahout programs. Utilizes &gt; &gt;
org.apache.hadoop.util.ProgramDriver to run main methods of other &gt; classes, &gt;
but first loads up default properties from a properties &gt;</p>
<blockquote>
<p>file.]{style=&ldquo;color:#353833;font-family:Arial, Helvetica,
sans-serif;font-size:12.16px;line-height:normal;&rdquo;}</p></blockquote>
<p>To run locally:</p>
```
$MAHOUT_HOME/bin/mahout run shortJobName [over-ride ops]
```
<p>Works like this: by default, the file &ldquo;driver.classes.props&rdquo; is loaded from
the classpath, which defines a mapping between short names like &ldquo;vectordump&rdquo;
and fully qualified class names. The format of driver.classes.props is like
so:</p>
```
fully.qualified.class.name = shortJobName : descriptive string
```
<p>The default properties to be applied to the program run is pulled out of, by
default, &ldquo;.props&rdquo; (also off of the classpath).</p>
<p>The format of the default properties files is as follows:</p>
```
  i|input = /path/to/my/input
  o|output = /path/to/my/output
  m|jarFile = /path/to/jarFile
  # etc - each line is shortArg|longArg = value
```
<p>[The next argument to the Driver is supposed to be the short name of &gt; the &gt;
class to be run (as defined in the driver.classes.props &gt;</p>
<blockquote>
<p>file).]{style=&ldquo;color:#353833;font-family:Arial, Helvetica,
sans-serif;font-size:12.16px;line-height:normal;&rdquo;}</p></blockquote>
<p>Then the class which will be run will have it&rsquo;s main called with</p>
```
main(new String[] { "--input", "/path/to/my/input", "--output", "/path/to/my/output" });
```
<p>[After all the &ldquo;default&rdquo; properties are loaded from the file, any &gt; further</p>
<blockquote>
<p>command-line arguments are taken in, and over-ride the &gt;
defaults.]{style=&ldquo;color:#353833;font-family:Arial, Helvetica,
sans-serif;font-size:12.16px;line-height:normal;&rdquo;}</p></blockquote>
<p>So if your driver.classes.props looks like so:</p>
```
org.apache.mahout.utils.vectors.VectorDumper = vecDump : dump vectors from a sequence file
```
<p>[and you have a file core/src/main/resources/vecDump.props which looks &gt;</p>
<blockquote>
<p>like]{style=&ldquo;color:#353833;font-family:Arial, Helvetica,
sans-serif;font-size:12.16px;line-height:normal;&rdquo;}</p></blockquote>
```
  o|output = /tmp/vectorOut
  s|seqFile = /my/vector/sequenceFile
```
<p>[And you execute the &gt; command-line:]{style=&ldquo;color:#353833;font-family:Arial,
Helvetica, sans-serif;font-size:12.16px;line-height:normal;&rdquo;}</p>
```
$MAHOUT_HOME/bin/mahout run vecDump -s /my/otherVector/sequenceFile
```
<p>[Then org.apache.mahout.utils.vectors.VectorDumper.main() will be called with
arguments:</p></blockquote>
<p>You can also implement it slightly differently by just dumping the jar into the
mahout home directory and naming it starting with &ldquo;mahout-&rdquo; i.e.
mahout-mydriver.jar</p>
<p>Hope this helps someone</p>
]]></content:encoded></item><item><title>Setting up Mahout in Linux</title><link>https://icle.es/2016/07/26/setting-up-mahout-in-linux/</link><pubDate>Tue, 26 Jul 2016 10:06:41 +0000</pubDate><guid>https://icle.es/2016/07/26/setting-up-mahout-in-linux/</guid><description>&lt;p>A few simple steps to get Mahout running in Linux. This is mostly about the bash
script to get it to run easily&lt;/p>
&lt;p>You&amp;rsquo;ll need to install Java first, then download and unpack the mahout
distribution.&lt;/p>
&lt;p>I then placed it in &lt;code>/usr/local/mahout&lt;/code>&lt;/p>
&lt;p>To be able to run Mahout from the path, the following bash script was placed in
&lt;code>/usr/local/bin&lt;/code>&lt;/p>
&lt;p>Update the paths as relevant&lt;/p>
```bash
 #!/bin/bash
 export MAHOUT_JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre/
export MAHOUT_HOME=/usr/local/mahout
export MAHOUT_HEAPSIZE=4000
export MAHOUT_LOCAL=y
```</description><content:encoded><![CDATA[<p>A few simple steps to get Mahout running in Linux. This is mostly about the bash
script to get it to run easily</p>
<p>You&rsquo;ll need to install Java first, then download and unpack the mahout
distribution.</p>
<p>I then placed it in <code>/usr/local/mahout</code></p>
<p>To be able to run Mahout from the path, the following bash script was placed in
<code>/usr/local/bin</code></p>
<p>Update the paths as relevant</p>
```bash
 #!/bin/bash
 export MAHOUT_JAVA_HOME=/usr/lib/jvm/java-8-oracle/jre/
export MAHOUT_HOME=/usr/local/mahout
export MAHOUT_HEAPSIZE=4000
export MAHOUT_LOCAL=y
```
]]></content:encoded></item></channel></rss>