Multi-variable linear regression

multi-linear-regression

I continue working with machine learning algorithms. In a previous post I talked about linear regression with one variable and I described different algorithms to predict hypothesis.

In this case, I’m playing with linear regression but, with some features. Linear regression only have one input feature and one output feature. For example, you can predict the price of a house give the house’s size. But imagine that you want predict the price of a house using size and rooms features. When you have more than one input feature is called ‘multi-variable linear regression’.

In the following figure we can see the two input features (size and rooms), the training data (red dots), and the predictions (blue dots). In this case, we can represent the information with a 3D model. If your model have more than three features you must research the way to represent all the data.

Continue reading

facebooktwittergoogle_pluslinkedinmailby feather
Posted in codigo, floss, libresoft, machine-learning | Leave a comment

Playing with machine learning: Linear Regression

linear_regression

Since two months ago I’m researching about machine learning and its algorithms. The goal is get a good unsupervised and clustering algorithm to analyze every android applications and predict what application you want to install or use in a particular time. The first step is learn and understand the theory of machine learning. For this,  I began to study the Machine Learning Course of Stanford. It’s a great and practical course with videos and material to help understand the classes.

The first model that I have studied is linear regression. This model consist in have a relation between two or more variables. For example, in my example I have a training data about the prices of the houses and its size in square meters. This training data is used to build a linear regression model to predict the prices of the house give the size of the house. As you  can see in the following figure, the black dots show the training data (I did web crawling to get real data). The blue line represents the trend line of the model, and the red dots show the predicts for two size of houses.

Continue reading

facebooktwittergoogle_pluslinkedinmailby feather
Posted in floss, libresoft, machine-learning | Leave a comment

How decompile an Android Application

Decompile is a process to revert the compile operation. I main, decompile converts the low level code in high level code. The Android application is compiled in APK container that groups files as: xml, images and class. APK containers are actually ZIP containers. An interest thing is can see the xml configuration or some source code of others applications. If this applications are Free Software is not a problem, but if this applications are privated we can’t see its configuration. The next application help you to decompile an APK file to see xml configuration and source code.

Some tools I’ve found:

Continue reading

facebooktwittergoogle_pluslinkedinmailby feather
Posted in Uncategorized | Leave a comment

The first prototype video of ESTUFA

ESTUFA is a framework that provides several ways to connect and re-use mobile applications (in previous post I already presented this idea). The system allow build “execution chains” to connect and plumb two applications.

This project is based in the idea of re-use and compose new applications using components (in this case Alchemist). It has a strong context with “end-user software engieneer”, we want implement a solution from end-user non-developers to build new applications without technical knowledge.

See the video to know how it’s possible connect IO FileManager with Twitter or GMail. For this, we use an execution chain that create a file zip from files of File Manager, upload it to dropbox, obtains a tiny URL pointing to dropbox and finally send this url to GMail or Twitter. The power of ESTUFA resides in its alchemists and the compatibility between these and applications.

If all goes well, this project will be my PhD thesis over the next 2 years :-)

 

facebooktwittergoogle_pluslinkedinmailby feather
Posted in android, estufa, libresoft | Leave a comment

Arduino & Android & ADK

The last Google I/O a new feature based in Android and Arduino was released. The ADK allows the communication between Android and Arduino using a USB connection. Google have developed a library called “USB Accessory” in Android and Arduino. So, this library help us to send and receive data through USB interface. Using the USB accessory we can control the Arduino board. We can power-on or power-off leds, servos, components and read the data of sensors (temperature, humidity, movement, etc).

The next video shows how is possible read/write an analog I/O (values between 0 and 1023) and read/write digital I/O (values 0 and 1). We have connected three leds to digital outputs and one potentiometer in an analog input. The potentiometer simulated all possibles values (0-1023 ~ 0-5v).

Arduino Source Code: ExampleBoardArduino.zip

Android Source Code: ExampleBoard.zip

facebooktwittergoogle_pluslinkedinmailby feather
Posted in android, arduino, codigo, libresoft | Leave a comment

New challenges about Android, AR and Arduino

During the next months I will work in three interesting topics. The first of them is the creation of a new architecture based in Android that allow communicate and integrate applications. The second  is the port of ARviewer to iPhone platform using phoneGap. And the last one is the very well-know Arduino and its possibilities with Android USB Host.

Some months ago we have started to developed a new idea about “create new android apps easily”. The magic idea is that the user can connect two o more applications with “connectors” (your way), although this applications haven’t been developed for that purpose. For example, imagine that you can (as user) configure twitter to show the all contents in ARviewer application, or you can configure to show this twitts in an amazing map. The developers don’t know the use of his data, only they configure some outputs and inputs and the final user is the responsible of link this applications. Numerous filters also are incorporated into the platform, so the final user can modify the data exchanged between applications. All the ideas are early but I wish tell you in more detail in the next posts.

Currently, ARviewer is the best FLOSS augmented reality viewer. The last year, we began the port of ARviewer to other platforms (iPhone) using a multi-platform framework. In the previous post I talked about the implementation in Android using PhoneGap. In short, we will have the development completed to run in iPhone platform. Some people have shown interest about this project, so we are very exciting about this and we are looking forward to show our work!

Google announced  in the last Google I/O a new feature: Android Open Accessory Development Kit. The new amazing feature allow communicate the Android devices with the Arduino boards using a USB HOST! This is a cool idea! New projects are shaping up using this technology to communicate micro-systems with Android devices. For example, imagine a little electronic circuit with Arduino that control a cooling system. You could connect your android phone to Arduino board to control and recollect all the information about the system. See an example of this idea [video]

The next 6 months I will work in these topics, so I wish tell you all the results about this interesting topics before the end of the year!

facebooktwittergoogle_pluslinkedinmailby feather
Posted in android, arduino, augmented_reality, libresoft | Leave a comment

Distributed Video Surveillance System based on Android

Security and Surveillance Systems have always been demand in the industrial and home environment. The cameras, which human eyes are able to collect all visual information from the environment. Extensions necessary and highly desirable in these systems, and that few possess, are integration and interconnection with other systems, video surveillance and display all the information on a mobile device, which lately is becoming essential in a peripheral daily life. Most existing surveillance systems are based on the hardware, and software is old and have not a good design, so it’s difficult allowing scalability and increased functionality.

This project, called Surveillance, raises the development of a distributed video system integrated in mobile device based on Android. For this we have designed a distributed system, multi-platform, multi-lenguage and high scalability. The system performs records through the cameras installed and it is associated with an alarm generation by motion detection. All this is managed and viewed from a mobile device based on Android with intelligent touchscreen. One of the most important features has been developed is receiving real-time video in mobile device, both the cameras and recordings made.

 

 

The system has been experimentally validated and proven correct operation. For the implementation of this project is used software platform architecture and JDEROBOT, distributed component programming six main functions that are: get the images from the camera, motion analysis, centralize the management of the recordings, making the recordings, display information on mobile and manage logical recordings and alarms. It has also opted to use frameworks, consolidated libraries and tools (ICE, GStreamer and VLC) to provide robustness to the system. Finally, we have integrated and improved several components of this infrastructure, obtaining a correct and efficient functioning.

Of sourse, this project is a FLOSS (Free Libre Open Source Software) project. You can obtain the source code and documentation in the next links:

 

Posted via email from rocapal’s posterous

facebooktwittergoogle_pluslinkedinmailby feather
Posted in android, camara, jderobot | Leave a comment

ARviewer, PhoneGap and Android

arviewer-phonegap

Three months ago I wrote a post describing the plan that Raúl Roman and I are involved: build an augmented reality interface using PhoneGap. Today, we have uploaded a beta version (0.1.0) of ARviewer-PhoneGap to Android Market. This version works fine and shows the geolocated nodes obtained from libregeosocial server. The next steps are:

  • We test this source code in IOS platform to check the real portability that phoneGap provide us.
  • We plan to add the “tagging mode” with phoneGap to allow tag new nodes/objetcs from the mobile.

Are very very similar the next images, right? Only we have found a critical problem with the refresh of nodes in the WebView using PhoneGap. We will study and analyze this behavior.

 

ARviewer PhoneGap

 

ARviewer Android (native)

 

More info: http://www.libregeosocial.org/node/24

Source Code (GPL): http://git.libresoft.es/ARviewer-phoneGap/

Android Market: https://market.android.com/details?id=com.libresoft.arviewer.phonegap

facebooktwittergoogle_pluslinkedinmailby feather
Posted in Uncategorized | 2 Comments

Kinect’s depth map on your Android device

Two weeks ago, I have received the new fashion gadget of Microsoft: the kinect sensor. Thanks for the community (libfreenect), this sensor designed for Xbox can be used in GNU/Linux systems. Lately I have the need of integrate anything with Android mobile (is it because I have over 3 years programming with Android?) So, I couldn’t pass up this opportunity!

Using JDEROBOT (a distributed framework to programming behaviors robotic) and ICE (Internet Communications Engine) is possible show the images of kinect in an Android mobile. Using the mobile we can see the normal image, the depth image, control the tilt movements and play with the leds. For this, it’s necessary connect the kinect to PC with jderobot running and the android mobile access to PC using wifi connection to obtain all the date and images.

Soon, all source code will be FLOSS, meanwhile you can see the next video.

facebooktwittergoogle_pluslinkedinmailby feather
Posted in android, androidfloss, jderobot, robotica | Leave a comment

AR interface in Android using phoneGap

Since 6 months ago we have evaluated the possibility to implement a new AR interface (based in our project ARviewer) using phoneGap. phoneGap is a mobile framework based in HTML5/JS that allow execute the same source code HTML5 in differents mobile platforms (iphone, android, blackberry). It seem a good way to create portable source code. Since 3 years ago I work in this project with Raúl Román, a crack coder!!

Currently using phoneGap is not possible obtain the stream camera in the webView widget. So, this part of the source code must be developed in the native platform. We find another problem. We could not put the webview transparent so it would look the camera in the background, and paint objects on top with HTML. In this case, we asked for this to David A. Lareo (Bcultura) and Julio Rabadán (Somms.net) and gave us some very interesting clues about this problem.

The solution is implemented in the source code that you can see below. It’s necessary that our main view (R.layout.main) is the main view, for this we do ‘setContentView’ and later we add the main view of ‘DroidGap’ using ‘addview’ and ‘getParent’. Once we have our view mixed with phonegap main view, we set the backgroundColor transparent.

    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        super.init();
        super.loadUrl("file:///android_asset/www/index.html");

        setContentView(R.layout.main);
        RelativeLayout view = (RelativeLayout)
                              findViewById(R.id.main_container);

        // appView is the WebView object
        View html = (View)appView.getParent();
        html.setBackgroundColor(Color.TRANSPARENT);
        view.addView (html,
                      new LayoutParams(LayoutParams.FILL_PARENT,
                      LayoutParams.FILL_PARENT));

        appView.setBackgroundColor(Color.TRANSPARENT);
    }

Currently, we have started this project so I will post the full source code in this blog

facebooktwittergoogle_pluslinkedinmailby feather
Posted in android, androidfloss, codigo, libresoft | Leave a comment