⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 supportvectormachinemodel.java

📁 一个数据挖掘软件ALPHAMINERR的整个过程的JAVA版源代码
💻 JAVA
📖 第 1 页 / 共 2 页
字号:
	{
		return _objSigmoidKernelType;
	}

	/**
	 * Replaces the existing SigmoidKernelType object with a new object.
	 * If you pass in a null value to this method, the SigmoidKernelType object is
	 * cleared and will not be marshaled.
	 * @param obj	A new object.
	 */
	public void setSigmoidKernelType(SigmoidKernelType obj)
	{
		this._objSigmoidKernelType = obj;
		if( obj == null )
            return;

        obj._setParent(this);
		_objLinearKernelType = null;
		_objPolynomialKernelType = null;
		_objRadialBasisKernelType = null;
	}
	/**
	 * Gets ModelStats object.
	 */
	public ModelStats getModelStats()
	{
		return _objModelStats;
	}

	/**
	 * Replaces the existing ModelStats object with a new object.
	 * If you pass in a null value to this method, the ModelStats object is
	 * cleared and will not be marshaled.
	 * @param obj	A new object.
	 */
	public void setModelStats(ModelStats obj)
	{
		this._objModelStats = obj;
		if( obj == null )
            return;

        obj._setParent(this);
	}
	/**
	 * Gets SupportVectors object.
	 */
	public SupportVectors getSupportVectors()
	{
		return _objSupportVectors;
	}

	/**
	 * Replaces the existing SupportVectors object with a new object.
	 * If you pass in a null value to this method, the SupportVectors object is
	 * cleared and will not be marshaled.
	 * @param obj	A new object.
	 */
	public void setSupportVectors(SupportVectors obj)
	{
		this._objSupportVectors = obj;
		if( obj == null )
            return;

        obj._setParent(this);
	}
	/**
	 * Gets Coefficients object.
	 */
	public Coefficients getCoefficients()
	{
		return _objCoefficients;
	}

	/**
	 * Replaces the existing Coefficients object with a new object.
	 * If you pass in a null value to this method, the Coefficients object is
	 * cleared and will not be marshaled.
	 * @param obj	A new object.
	 */
	public void setCoefficients(Coefficients obj)
	{
		this._objCoefficients = obj;
		if( obj == null )
            return;

        obj._setParent(this);
	}

	/**
	 * Marshals this object to an element.
	 */
	public com.borland.xml.toolkit.Element marshal()
	{
		com.borland.xml.toolkit.Element elem = new com.borland.xml.toolkit.Element(get_TagName());
		/** Marshals "modelName" attribute */
		elem.addAttribute(modelName.marshal());
		/** Marshals "algorithmName" attribute */
		elem.addAttribute(algorithmName.marshal());
		/** Marshals "functionName" attribute */
		elem.addAttribute(functionName.marshal());
		/** Marshals "svm_type" attribute */
		elem.addAttribute(svm_type.marshal());
		/** Marshals a list of Extension objects to elements */
		Iterator it1 = _objExtension.iterator();
		while( it1.hasNext() )
		{
			Extension obj = (Extension)it1.next();
			if( obj != null )
				elem.addContent(obj.marshal());
		}
		/** Marshals a MiningSchema object to an element */
		if( _objMiningSchema != null )
			elem.addContent(_objMiningSchema.marshal());
		/** Marshals a LinearKernelType object to an element */
		if( _objLinearKernelType != null )
			elem.addContent(_objLinearKernelType.marshal());
		/** Marshals a PolynomialKernelType object to an element */
		if( _objPolynomialKernelType != null )
			elem.addContent(_objPolynomialKernelType.marshal());
		/** Marshals a RadialBasisKernelType object to an element */
		if( _objRadialBasisKernelType != null )
			elem.addContent(_objRadialBasisKernelType.marshal());
		/** Marshals a SigmoidKernelType object to an element */
		if( _objSigmoidKernelType != null )
			elem.addContent(_objSigmoidKernelType.marshal());
		/** Marshals a ModelStats object to an element */
		if( _objModelStats != null )
			elem.addContent(_objModelStats.marshal());
		/** Marshals a SupportVectors object to an element */
		if( _objSupportVectors != null )
			elem.addContent(_objSupportVectors.marshal());
		/** Marshals a Coefficients object to an element */
		if( _objCoefficients != null )
			elem.addContent(_objCoefficients.marshal());

		return elem;
	}

	/**
	 * Unmarshals the specified "SupportVectorMachineModel" element back to a SupportVectorMachineModel object.
	 */
	public static SupportVectorMachineModel unmarshal(com.borland.xml.toolkit.Element elem)
	{
		if( elem == null )
			return null;

		SupportVectorMachineModel __objSupportVectorMachineModel = new SupportVectorMachineModel();
		if( __objSupportVectorMachineModel != null ) //found the element?
		{
			/** Unmarshals "modelName" attribute */
			__objSupportVectorMachineModel.modelName.setValue(elem.getAttribute("modelName"));
			/** Unmarshals "algorithmName" attribute */
			__objSupportVectorMachineModel.algorithmName.setValue(elem.getAttribute("algorithmName"));
			/** Unmarshals "functionName" attribute */
			__objSupportVectorMachineModel.functionName.setValue(elem.getAttribute("functionName"));
			/** Unmarshals "svm_type" attribute */
			__objSupportVectorMachineModel.svm_type.setValue(elem.getAttribute("svm_type"));
		}
		/** Unmarshals a list of "<<_tagName_>>" elements back to Extension objects. */
		Iterator it1 = elem.getChildren(Extension._tagName).iterator();
		while( it1.hasNext() )
			__objSupportVectorMachineModel.addExtension(Extension.unmarshal((com.borland.xml.toolkit.Element)it1.next()));
		/** Unmarshals an element back to a MiningSchema object */
		__objSupportVectorMachineModel.setMiningSchema(MiningSchema.unmarshal(elem.getChild(MiningSchema._tagName)));
		/** Unmarshals an element back to a LinearKernelType object */
		__objSupportVectorMachineModel.setLinearKernelType(LinearKernelType.unmarshal(elem.getChild(LinearKernelType._tagName)));
		/** Unmarshals an element back to a PolynomialKernelType object */
		__objSupportVectorMachineModel.setPolynomialKernelType(PolynomialKernelType.unmarshal(elem.getChild(PolynomialKernelType._tagName)));
		/** Unmarshals an element back to a RadialBasisKernelType object */
		__objSupportVectorMachineModel.setRadialBasisKernelType(RadialBasisKernelType.unmarshal(elem.getChild(RadialBasisKernelType._tagName)));
		/** Unmarshals an element back to a SigmoidKernelType object */
		__objSupportVectorMachineModel.setSigmoidKernelType(SigmoidKernelType.unmarshal(elem.getChild(SigmoidKernelType._tagName)));
		/** Unmarshals an element back to a ModelStats object */
		__objSupportVectorMachineModel.setModelStats(ModelStats.unmarshal(elem.getChild(ModelStats._tagName)));
		/** Unmarshals an element back to a SupportVectors object */
		__objSupportVectorMachineModel.setSupportVectors(SupportVectors.unmarshal(elem.getChild(SupportVectors._tagName)));
		/** Unmarshals an element back to a Coefficients object */
		__objSupportVectorMachineModel.setCoefficients(Coefficients.unmarshal(elem.getChild(Coefficients._tagName)));

		return __objSupportVectorMachineModel;
	}

	/**
	 * Validates this object. If you pass <code>true</code> to this method, it
	 * checks for the first error and stops. On the other hand, if you pass
	 * <code>false</code> to this method, it collects all the errors by
	 * visiting every available elements.
	 * @param firstError	<code>true</code> to exit this method when the first error
	 * is found; <code>false</code> to collect all errors.
	 * @return com.borland.xml.toolkit.ErrorList	A list that contains one or more errors.
	 * @see com.borland.xml.toolkit.XmlObject#validate()
	 * @see com.borland.xml.toolkit.XmlObject#isValid()
	 * @see com.borland.xml.toolkit.ErrorList
	 */
	public com.borland.xml.toolkit.ErrorList validate(boolean firstError)
	{
		com.borland.xml.toolkit.ErrorList errors = new com.borland.xml.toolkit.ErrorList();

		/** Extension is zero or more */
		Iterator it1 = _objExtension.iterator();
		while( it1.hasNext() )
		{
			Extension obj = (Extension)it1.next();
			if( obj != null )
			{
				errors.add(obj.validate(firstError));
				if( firstError && errors.size() > 0 )
					return errors;
			}
		}
		/** MiningSchema is mandatory */
		if( _objMiningSchema != null )
			errors.add(_objMiningSchema.validate(firstError));
		else
			errors.add(new com.borland.xml.toolkit.ElementError(this, MiningSchema.class));
		if( firstError && errors.size() > 0 )
			return errors;
		/** "or" block */
		if( _objLinearKernelType != null || _objPolynomialKernelType != null || _objRadialBasisKernelType != null )
		{
			/** "or" block */
			if( _objLinearKernelType != null || _objPolynomialKernelType != null )
			{
				/** "or" block */
				if( _objLinearKernelType != null )
				{
					/** LinearKernelType is mandatory */
					if( _objLinearKernelType != null )
						errors.add(_objLinearKernelType.validate(firstError));
					else
						errors.add(new com.borland.xml.toolkit.ElementError(this, LinearKernelType.class));
					if( firstError && errors.size() > 0 )
						return errors;
				}
				if( _objPolynomialKernelType != null )
				{
					/** PolynomialKernelType is mandatory */
					if( _objPolynomialKernelType != null )
						errors.add(_objPolynomialKernelType.validate(firstError));
					else
						errors.add(new com.borland.xml.toolkit.ElementError(this, PolynomialKernelType.class));
					if( firstError && errors.size() > 0 )
						return errors;
				}
				if( !(_objLinearKernelType != null) && !(_objPolynomialKernelType != null) )   /** missing one or more elements? */
				{
					com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
					errors1.add(new com.borland.xml.toolkit.ElementError(this, LinearKernelType.class));
					errors1.add(new com.borland.xml.toolkit.ElementError(this, PolynomialKernelType.class));
					errors.add(errors1);
					if( firstError && errors.size() > 0 )
						return errors;
				}
			}
			if( _objRadialBasisKernelType != null )
			{
				/** RadialBasisKernelType is mandatory */
				if( _objRadialBasisKernelType != null )
					errors.add(_objRadialBasisKernelType.validate(firstError));
				else
					errors.add(new com.borland.xml.toolkit.ElementError(this, RadialBasisKernelType.class));
				if( firstError && errors.size() > 0 )
					return errors;
			}
			if( !(_objLinearKernelType != null || _objPolynomialKernelType != null) && !(_objRadialBasisKernelType != null) )   /** missing one or more elements? */
			{
				com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
				errors1.add(new com.borland.xml.toolkit.ElementError(this, LinearKernelType.class));
				errors1.add(new com.borland.xml.toolkit.ElementError(this, PolynomialKernelType.class));
				errors1.add(new com.borland.xml.toolkit.ElementError(this, RadialBasisKernelType.class));
				errors.add(errors1);
					if( firstError && errors.size() > 0 )
						return errors;
			}
		}
		if( _objSigmoidKernelType != null )
		{
			/** SigmoidKernelType is mandatory */
			if( _objSigmoidKernelType != null )
				errors.add(_objSigmoidKernelType.validate(firstError));
			else
				errors.add(new com.borland.xml.toolkit.ElementError(this, SigmoidKernelType.class));
			if( firstError && errors.size() > 0 )
				return errors;
		}
		if( !(_objLinearKernelType != null || _objPolynomialKernelType != null || _objRadialBasisKernelType != null) && !(_objSigmoidKernelType != null) )   /** missing one or more elements? */
		{
			com.borland.xml.toolkit.OrErrorList errors1 = new com.borland.xml.toolkit.OrErrorList();
			errors1.add(new com.borland.xml.toolkit.ElementError(this, LinearKernelType.class));
			errors1.add(new com.borland.xml.toolkit.ElementError(this, PolynomialKernelType.class));
			errors1.add(new com.borland.xml.toolkit.ElementError(this, RadialBasisKernelType.class));
			errors1.add(new com.borland.xml.toolkit.ElementError(this, SigmoidKernelType.class));
			errors.add(errors1);
					if( firstError && errors.size() > 0 )
						return errors;
		}
		/** ModelStats is optional */
		if( _objModelStats != null )
		{
			errors.add(_objModelStats.validate(firstError));
			if( firstError && errors.size() > 0 )
				return errors;
		}
		/** SupportVectors is mandatory */
		if( _objSupportVectors != null )
			errors.add(_objSupportVectors.validate(firstError));
		else
			errors.add(new com.borland.xml.toolkit.ElementError(this, SupportVectors.class));
		if( firstError && errors.size() > 0 )
			return errors;
		/** Coefficients is mandatory */
		if( _objCoefficients != null )
			errors.add(_objCoefficients.validate(firstError));
		else
			errors.add(new com.borland.xml.toolkit.ElementError(this, Coefficients.class));
		if( firstError && errors.size() > 0 )
			return errors;

		return errors.size()==0 ? null : errors;
	}

	/**
	 * Returns a list containing all child elements. Each element in the list is a subclass
	 * of XmlObject.
	 */
	public java.util.List _getChildren()
	{
		java.util.List children = new java.util.ArrayList();
		/** adds _objExtension */
		if( _objExtension != null && _objExtension.size() > 0 )
			children.add(_objExtension);
		/** adds _objMiningSchema */
		if( _objMiningSchema != null )
			children.add(_objMiningSchema);
		/** adds _objLinearKernelType */
		if( _objLinearKernelType != null )
			children.add(_objLinearKernelType);
		/** adds _objPolynomialKernelType */
		if( _objPolynomialKernelType != null )
			children.add(_objPolynomialKernelType);
		/** adds _objRadialBasisKernelType */
		if( _objRadialBasisKernelType != null )
			children.add(_objRadialBasisKernelType);
		/** adds _objSigmoidKernelType */
		if( _objSigmoidKernelType != null )
			children.add(_objSigmoidKernelType);
		/** adds _objModelStats */
		if( _objModelStats != null )
			children.add(_objModelStats);
		/** adds _objSupportVectors */
		if( _objSupportVectors != null )
			children.add(_objSupportVectors);
		/** adds _objCoefficients */
		if( _objCoefficients != null )
			children.add(_objCoefficients);
		return children;
	}


	/**
	 * Gets the tag name of this element.
	 */
	public String get_TagName()
	{
		return _tagName;
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -