Error in loading SVM Learning Configuration File in Gate Tool - machine-learning

I am new to machine learning. When I tried learning through gate, it is showing some error. The learning configuration file is given below.
<?xml version="1.0"?>
<ML-CONFIG>
<SURROUND value="false"/>
<FILTERING ratio='0.2' dis='far'/>
<EVALUATION method="holdout" runs="2" ratio="0.66"/>
<multiClassification2Binary method="one-vs-anothers" thread-pool-size="2"/>
<PARAMETER name="thresholdProbabilityBoundary" value="1.0"/>
<PARAMETER name="thresholdProbabilityEntity" value="1.0"/>
<PARAMETER name="thresholdProbabilityClassification" value="0.0"/>
<IS-LABEL-UPDATABLE value="true"/>
<IS-NLPFEATURELIST-UPDATABLE value="true"/>
<ENGINE nickname="SVM" implementationName="SVMLibSvmJava" options = "-s 0 -t 1 -d 4 -c 5 -tau 1.2"/>
</ML-CONFIG>
Training attributes are inside this file. When I trained without the line containing multiclass xml tag it is working. when this line is added, an error is showing like below
Caused by: org.jdom.input.JDOMParseException: Error on line 6 of document file:/home/cognicor/vagateplugin/scripts/ML_script/learningsvm: Element type "multiClassi" must be followed by either attribute specifications, ">" or "/>".
I am not aware of this thing and why it happens and seek for a solution.

Related

Gremlin: Read edge GraphML file and node GraphML file in separate queries

I have two files that I want to load by using g.io(<name file>).read().iterate(): nodes.xml and edges.xml.
The nodes.xml file contains the nodes of the graph I want to upload, and its contents are this:
<?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="labelV" for="node" attr.name="labelV" attr.type="string" />
<key id="name" for="node" attr.name="name" attr.type="string" />
<key id="age" for="node" attr.name="age" attr.type="int" />
<graph id="G" edgedefault="directed">
<node id="1">
<data key="labelV">person</data>
<data key="name">marko</data>
<data key="age">29</data>
</node>
<node id="2">
<data key="labelV">person</data>
<data key="name">vadas</data>
<data key="age">27</data>
</node>
</graph>
</graphml>
The edges.xml file contains the edges of the graph I want to upload, and its content are this:
<?xml version='1.0' encoding='utf-8'?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://graphml.graphdrawing.org/xmlns http://graphml.graphdrawing.org/xmlns/1.0/graphml.xsd">
<key id="labelE" for="edge" attr.name="labelE" attr.type="string" />
<key id="weight" for="edge" attr.name="weight" attr.type="double" />
<graph id="G" edgedefault="directed">
<edge id="7" source="1" target="2">
<data key="labelE">knows</data>
<data key="weight">0.5</data>
</edge>
</graph>
</graphml>
I want to upload the nodes first by running g.io('nodes.xml').read().iterate() and then the edges by running g.io('edges.xml').read().iterate(). But when I upload the edges.xml, instead of adding edges to the previously created nodes, it creates new nodes.
It is possible to easily load the nodes first and then the edges in separate queries with a similar command in Gremlin? I know this can be accomplished with complex queries that involve reading and creating edge by edge the edges in the edges.xml file via user queries, but I'm wondering if there is something easier. Also, I wouldn't want to upload a single file with all the nodes and edges.
I'm afraid that the GraphMLReader doesn't work that way. It's not designed to read into an existing graph. I honestly can't remember if this was done purposefully or not.
The code isn't too complicated though. You could probably just modify it to work they way that you want. You can see here where the code checks the vertex cache for the id. That cache is empty on your second execution because it is only filled by way of new vertex additions - it doesn't remember any from your first run and it doesn't read from the graph directly for your second run. Simply change that to logic to better suit your needs.

How to set up parameter in hector_localization stack to fuse IMU and Barometer (Pressure sensor)?

Im checking the hector_localization stack, that provide the full 6DOF pose of a robot or platform. It uses various sensor sources, which are fused using an Extended Kalman filter. Acceleration and angular rates from an inertial measurement unit (IMU) serve as primary measurements and also support barometric pressure sensors. I check the launch which is this one
<?xml version="1.0"?>
<launch>
<node pkg="hector_pose_estimation" type="pose_estimation" name="hector_pose_estimation" />
<node pkg="rviz" type="rviz" name="hector_pose_estimation_rviz" args="-d $(find hector_pose_estimation)/rviz_cfg/hector_pose_estimation.rviz" />
</launch>
But can not find the way hot to set up the hector_pose_estimation node and the launch file to get IMU and Pressure (barometer) data as input. Any help?
Thanks
You have to remap the input topics hector is expecting to the topics you're systems are outputting. Check this page for a full list of topics and params. In the end your launch file should look something like this. Note you need to put in your own topic names.
<?xml version="1.0"?>
<launch>
<node pkg="hector_pose_estimation" type="pose_estimation" name="hector_pose_estimation">
<remap from="raw_imu" to="/your_imu_topic" />
<remap from="pressure_height" to="/your_barometric_topic" />
</node>
<node pkg="rviz" type="rviz" name="hector_pose_estimation_rviz" args="-d $(find hector_pose_estimation)/rviz_cfg/hector_pose_estimation.rviz" />
</launch>

How to publish a new topic to slam gmapping package in multiple-robot

I have used this command in the terminal to publish /scan_new topic to the gmapping package in tb3_0 robot ROS_NAMESPACE=tb3_0 rosrun gmapping slam_gmapping scan:=scan_new set_base_frame:=tb3_0/base_footprint set_odom_frame:=tb3_0/odom set_map_frame:=tb3_0/map, but the gampping package is not subscribe to the /scan_new topic. What is the correct command to make sure that gmapping package of the tb3_0 robot is subscribe to the /scan_new topic?
*notes: As in the figure, red word is the ann_publisher node publish to the /scan_new and the gmapping package subscribe to /scan_new topic
This isn't working as expected because you're giving the node a namespace. When doing this, topic remaps that don't specify a namespace will default to the node's namespace. Here it's /tb3_0, meaning it's actually trying to subscribe to /tb3_0/scan_new. There are a few different ways to fix this, the first being that you can just specify the global namespace with a / like so: scan:=/scan_new . You can also do the same thing, but in a launch file:
<?xml version="1.0"?>
<launch>
<node ns="tb3_0" name="slam_gmapping" pkg="gmapping" type="slam_gmapping" output="screen">
<param name="base_frame" value="tb3_0/base_footprint" />
<param name="odom_frame" value="tb3_0/odom" />
<param name="map_frame" value="tb3_0/map" />
<remap from="scan" to="/scan_new" />
</node>
</launch>
I would highly suggest using the launch file method. It is much cleaner and will be much easier to expand as the number of nodes you want to run increase.

Nosqlunit-neo4j unable to assign label to Node in Spring Data Neo4j 4

It seems that Nosqlunit-neo4j is not compatible with SDN 4 since TypeRepresentationStrategy is removed. It adds the node defined in following graphml xml file into test database but doesn't assign it a label due to which repository.count() returns 0. However, if I query the database natively, then it does fetches the node without any Label.
<?xml version="1.0" encoding="UTF-8"?>
<graphml xmlns="http://graphml.graphdrawing.org/xmlns">
<key id="__type__" for="node" attr.name="__type__" attr.type="string"></key>
<key id="productId" for="node" attr.name="productId" attr.type="string"></key>
<graph id="G" edgedefault="directed">
<node id="3">
<data key="__type__">com.my.package.Product</data>
<data key="productId">100001235</data>
<index name="__types__" key="className">com.my.package.Product
</index>
</node>
</graph>
</graphml>
Does anyone facing the same issue?
If you use the label Product directly it should work.
You don't need the index or the __type__ properties anymore.

error loading svm learning configuration file in gate tool

I am new to machine learning. When I tried learning through gate, it is showing some error. The learning configuration file is given below.
<?xml version="1.0"?>
<ML-CONFIG>
<SURROUND value="false"/>
<FILTERING ratio='0.2' dis='far'/>
<EVALUATION method="holdout" runs="2" ratio="0.66"/>
<multiClassification2Binary method="one-vs-anothers" thread-pool-size="2"/>
<PARAMETER name="thresholdProbabilityBoundary" value="1.0"/>
<PARAMETER name="thresholdProbabilityEntity" value="1.0"/>
<PARAMETER name="thresholdProbabilityClassification" value="0.0"/>
<IS-LABEL-UPDATABLE value="true"/>
<IS-NLPFEATURELIST-UPDATABLE value="true"/>
<ENGINE nickname="SVM" implementationName="SVMLibSvmJava" options = "-s 0 -t 1 -d 4 -c 5 -tau 1.2"/>
</ML-CONFIG>
Training attributes are inside this file. When I trained without the line containing multiclass xml tag it is working. when this line is added, an error is showing like below
Caused by: org.jdom.input.JDOMParseException: Error on line 6 of document file:/home/cognicor/vagateplugin/scripts/ML_script/learningsvm: Element type "multiClassi" must be followed by either attribute specifications, ">" or "/>".
I am not aware of this thing and why it happens and seek for a solution.
The problem is in the multiClassification2Binary string. There is a single glyph fi that contains two joined characters "fi" together. You probably copied the text from some pdf... Simply replace fi by fi and the error should go away.

Resources