template <class T> CStreamingDenseFeatures<T>::CStreamingDenseFeatures(CDenseFeatures<T>* dense_features,
			 float64_t* lab)
	: CStreamingDotFeatures()
{
	CStreamingFileFromDenseFeatures<T>* file;
	bool is_labelled;
	int32_t size = 1024;

	if (lab)
	{
		is_labelled = true;
		file = new CStreamingFileFromDenseFeatures<T>(dense_features, lab);
	}
	else
	{
		is_labelled = false;
		file = new CStreamingFileFromDenseFeatures<T>(dense_features);
	}

	SG_REF(file);

	init(file, is_labelled, size);
	set_read_functions();
	parser.set_free_vector_after_release(false);
	parser.set_free_vectors_on_destruct(false);
	seekable=true;
}
void CStreamingHashedSparseFeatures<ST>::init(CStreamingFile* file, bool is_labelled,
	int32_t size, int32_t d, bool use_quadr, bool keep_lin_terms)
{
	dim = d;
	SG_ADD(&dim, "dim", "Size of target dimension", MS_NOT_AVAILABLE);

	use_quadratic = use_quadr;
	keep_linear_terms = keep_lin_terms;

	SG_ADD(&use_quadratic, "use_quadratic", "Whether to use quadratic features",
		MS_NOT_AVAILABLE);
	SG_ADD(&keep_linear_terms, "keep_linear_terms", "Whether to keep the linear terms or not",
		MS_NOT_AVAILABLE);

	has_labels = is_labelled;
	if (file)
	{
		working_file = file;
		SG_REF(working_file);
		parser.init(file, is_labelled, size);
		seekable = false;
	}
	else
		file = NULL;

	set_read_functions();
	parser.set_free_vector_after_release(false);

	set_generic<ST>();
}
Example #3
0
CStreamingSparseFeatures<T>::CStreamingSparseFeatures(CStreamingFile* file,
			 bool is_labelled,
			 int32_t size)
	: CStreamingDotFeatures()
{
	set_read_functions();
	init(file, is_labelled, size);
}
CStreamingStringFeatures<T>::CStreamingStringFeatures(CStreamingFile* file,
			 bool is_labelled,
			 int32_t size)
	: CStreamingFeatures()
{
	init(file, is_labelled, size);
	set_read_functions();
	remap_to_bin=false;
}
template <class T> CStreamingDenseFeatures<T>::CStreamingDenseFeatures(CStreamingFile* file,
			 bool is_labelled,
			 int32_t size)
	: CStreamingDotFeatures()
{
	init(file, is_labelled, size);
	set_read_functions();
	parser.set_free_vector_after_release(false);
}
CStreamingStringFeatures<T>::CStreamingStringFeatures() : CStreamingFeatures()
{
	init();
	set_read_functions();
	remap_to_bin=false;
}
template <class T> CStreamingDenseFeatures<T>::CStreamingDenseFeatures() : CStreamingDotFeatures()
{
	set_read_functions();
	init();
	parser.set_free_vector_after_release(false);
}
Example #8
0
CStreamingSparseFeatures<T>::CStreamingSparseFeatures() : CStreamingDotFeatures()
{
	set_read_functions();
	init();
}