create datadict
This commit is contained in:
parent
88cc968b0a
commit
bfd63cb1dc
@ -2,8 +2,9 @@
|
|||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="ChangeListManager">
|
<component name="ChangeListManager">
|
||||||
<list default="true" id="828778c9-9d97-422f-a727-18ddbd059b85" name="Default Changelist" comment="">
|
<list default="true" id="828778c9-9d97-422f-a727-18ddbd059b85" name="Default Changelist" comment="">
|
||||||
<change afterPath="$PROJECT_DIR$/Assiging/feature_hashing.py" afterDir="false" />
|
<change afterPath="$PROJECT_DIR$/Assiging/datadict.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||||
|
<change beforePath="$PROJECT_DIR$/Assiging/feature_hashing.py" beforeDir="false" afterPath="$PROJECT_DIR$/Assiging/feature_hashing.py" afterDir="false" />
|
||||||
<change beforePath="$PROJECT_DIR$/data.py" beforeDir="false" afterPath="$PROJECT_DIR$/data.py" afterDir="false" />
|
<change beforePath="$PROJECT_DIR$/data.py" beforeDir="false" afterPath="$PROJECT_DIR$/data.py" afterDir="false" />
|
||||||
</list>
|
</list>
|
||||||
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
|
||||||
@ -50,7 +51,7 @@
|
|||||||
</list>
|
</list>
|
||||||
</option>
|
</option>
|
||||||
</component>
|
</component>
|
||||||
<component name="RunManager" selected="Python.main">
|
<component name="RunManager" selected="Python.feature_hashing">
|
||||||
<configuration name="board" type="PythonConfigurationType" factoryName="Python" temporary="true">
|
<configuration name="board" type="PythonConfigurationType" factoryName="Python" temporary="true">
|
||||||
<module name="wozek" />
|
<module name="wozek" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
@ -73,6 +74,28 @@
|
|||||||
<option name="INPUT_FILE" value="" />
|
<option name="INPUT_FILE" value="" />
|
||||||
<method v="2" />
|
<method v="2" />
|
||||||
</configuration>
|
</configuration>
|
||||||
|
<configuration name="feature_hashing" type="PythonConfigurationType" factoryName="Python" temporary="true">
|
||||||
|
<module name="wozek" />
|
||||||
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
|
<option name="PARENT_ENVS" value="true" />
|
||||||
|
<envs>
|
||||||
|
<env name="PYTHONUNBUFFERED" value="1" />
|
||||||
|
</envs>
|
||||||
|
<option name="SDK_HOME" value="" />
|
||||||
|
<option name="WORKING_DIRECTORY" value="$PROJECT_DIR$/Assiging" />
|
||||||
|
<option name="IS_MODULE_SDK" value="true" />
|
||||||
|
<option name="ADD_CONTENT_ROOTS" value="true" />
|
||||||
|
<option name="ADD_SOURCE_ROOTS" value="true" />
|
||||||
|
<EXTENSION ID="PythonCoverageRunConfigurationExtension" runner="coverage.py" />
|
||||||
|
<option name="SCRIPT_NAME" value="$PROJECT_DIR$/Assiging/feature_hashing.py" />
|
||||||
|
<option name="PARAMETERS" value="" />
|
||||||
|
<option name="SHOW_COMMAND_LINE" value="false" />
|
||||||
|
<option name="EMULATE_TERMINAL" value="false" />
|
||||||
|
<option name="MODULE_MODE" value="false" />
|
||||||
|
<option name="REDIRECT_INPUT" value="false" />
|
||||||
|
<option name="INPUT_FILE" value="" />
|
||||||
|
<method v="2" />
|
||||||
|
</configuration>
|
||||||
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true">
|
<configuration name="main" type="PythonConfigurationType" factoryName="Python" temporary="true">
|
||||||
<module name="wozek" />
|
<module name="wozek" />
|
||||||
<option name="INTERPRETER_OPTIONS" value="" />
|
<option name="INTERPRETER_OPTIONS" value="" />
|
||||||
@ -98,9 +121,11 @@
|
|||||||
<list>
|
<list>
|
||||||
<item itemvalue="Python.board" />
|
<item itemvalue="Python.board" />
|
||||||
<item itemvalue="Python.main" />
|
<item itemvalue="Python.main" />
|
||||||
|
<item itemvalue="Python.feature_hashing" />
|
||||||
</list>
|
</list>
|
||||||
<recent_temporary>
|
<recent_temporary>
|
||||||
<list>
|
<list>
|
||||||
|
<item itemvalue="Python.feature_hashing" />
|
||||||
<item itemvalue="Python.main" />
|
<item itemvalue="Python.main" />
|
||||||
<item itemvalue="Python.board" />
|
<item itemvalue="Python.board" />
|
||||||
</list>
|
</list>
|
||||||
@ -125,7 +150,7 @@
|
|||||||
<workItem from="1589745409339" duration="739000" />
|
<workItem from="1589745409339" duration="739000" />
|
||||||
<workItem from="1589752301424" duration="1007000" />
|
<workItem from="1589752301424" duration="1007000" />
|
||||||
<workItem from="1589753322316" duration="835000" />
|
<workItem from="1589753322316" duration="835000" />
|
||||||
<workItem from="1589814601057" duration="2835000" />
|
<workItem from="1589814601057" duration="4208000" />
|
||||||
</task>
|
</task>
|
||||||
<task id="LOCAL-00001" summary="create Shelf">
|
<task id="LOCAL-00001" summary="create Shelf">
|
||||||
<created>1589815443652</created>
|
<created>1589815443652</created>
|
||||||
@ -141,7 +166,14 @@
|
|||||||
<option name="project" value="LOCAL" />
|
<option name="project" value="LOCAL" />
|
||||||
<updated>1589816028640</updated>
|
<updated>1589816028640</updated>
|
||||||
</task>
|
</task>
|
||||||
<option name="localTasksCounter" value="3" />
|
<task id="LOCAL-00003" summary="changed CreateDataSweets to lowercase">
|
||||||
|
<created>1589822196451</created>
|
||||||
|
<option name="number" value="00003" />
|
||||||
|
<option name="presentableId" value="LOCAL-00003" />
|
||||||
|
<option name="project" value="LOCAL" />
|
||||||
|
<updated>1589822196451</updated>
|
||||||
|
</task>
|
||||||
|
<option name="localTasksCounter" value="4" />
|
||||||
<servers />
|
<servers />
|
||||||
</component>
|
</component>
|
||||||
<component name="TypeScriptGeneratedFilesManager">
|
<component name="TypeScriptGeneratedFilesManager">
|
||||||
@ -163,10 +195,12 @@
|
|||||||
<component name="VcsManagerConfiguration">
|
<component name="VcsManagerConfiguration">
|
||||||
<MESSAGE value="create Shelf" />
|
<MESSAGE value="create Shelf" />
|
||||||
<MESSAGE value="create addShelf method in Field class" />
|
<MESSAGE value="create addShelf method in Field class" />
|
||||||
<option name="LAST_COMMIT_MESSAGE" value="create addShelf method in Field class" />
|
<MESSAGE value="changed CreateDataSweets to lowercase" />
|
||||||
|
<option name="LAST_COMMIT_MESSAGE" value="changed CreateDataSweets to lowercase" />
|
||||||
</component>
|
</component>
|
||||||
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
<component name="com.intellij.coverage.CoverageDataManagerImpl">
|
||||||
<SUITE FILE_PATH="coverage/AL_2020$main.coverage" NAME="main Coverage Results" MODIFIED="1589754127142" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/AL_2020$main.coverage" NAME="main Coverage Results" MODIFIED="1589754127142" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
|
<SUITE FILE_PATH="coverage/AL_2020$feature_hashing.coverage" NAME="feature_hashing Coverage Results" MODIFIED="1589822405133" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$/Assiging" />
|
||||||
<SUITE FILE_PATH="coverage/wozek$main.coverage" NAME="main Coverage Results" MODIFIED="1589556038208" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/wozek$main.coverage" NAME="main Coverage Results" MODIFIED="1589556038208" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
<SUITE FILE_PATH="coverage/wozek$board.coverage" NAME="board Coverage Results" MODIFIED="1589210811600" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
<SUITE FILE_PATH="coverage/wozek$board.coverage" NAME="board Coverage Results" MODIFIED="1589210811600" SOURCE_PROVIDER="com.intellij.coverage.DefaultCoverageFileProvider" RUNNER="coverage.py" COVERAGE_BY_TEST_ENABLED="true" COVERAGE_TRACING_ENABLED="false" WORKING_DIRECTORY="$PROJECT_DIR$" />
|
||||||
</component>
|
</component>
|
||||||
|
28
Assiging/datadict.py
Normal file
28
Assiging/datadict.py
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
from sweets import Sweets
|
||||||
|
|
||||||
|
|
||||||
|
def create_data_dict():
|
||||||
|
products_as_dict = []
|
||||||
|
|
||||||
|
sweet = Sweets('Mars', 'czekoladowy', 'baton', 'sredni', 2.49)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Mars', 'czekoladowy', 'czekolada', 'duzy', 4.99)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Mars', 'czekoladowy', 'czekolada', 'ogromny', 11.26)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('M&M', 'czekoladowy', 'czekolada', 'duzy', 3.99)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('M&M', 'czekoladowy', 'baton', 'sredni', 2.89)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Nestle', 'bananowy', 'landrynka', 'maly', 0.39)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Nestle', 'truskawkowy', 'landrynka', 'maly', 0.39)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Nestle', 'cola', 'landrynka', 'maly', 0.49)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Wedel', 'czekoladowy', 'baton', 'sredni', 1.99)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
sweet = Sweets('Maoam', 'truskawkowy', 'guma', 'maly', 0.25)
|
||||||
|
products_as_dict.append(vars(sweet))
|
||||||
|
|
||||||
|
return products_as_dict
|
@ -1,6 +1,5 @@
|
|||||||
from sklearn.feature_extraction import FeatureHasher
|
from sklearn.feature_extraction import FeatureHasher
|
||||||
from data import create_data_sweets
|
|
||||||
|
|
||||||
data = create_data_sweets()
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
print(f.toarray())
|
Loading…
Reference in New Issue
Block a user